Solved

vba to close Outlook's "Enter Network Password" dialog  box.

Posted on 2013-01-11
6
613 Views
Last Modified: 2013-01-20
About once a week Outlook incorrectly displays the "Enter Network Password" dialog which asks us to "Please type your user name and password".

We simply click "OK" and processing resumes normally.

Unfortunately, one computer uses Outlook 2003's NewMailEx subroutine much like a server. Outlooks stays up all night receiving emails which are transfered to an Access database.  

When the server gets the "Enter Network Password" dialog, the send receive stalls while waiting for user to click "OK". The dialog is non-modal, so some of my vba code continues to run, but the NewMailEx routine does not receive anymore emails.

I already have setTimer code that runs every 5 minutes. It continues to run and now detects the hang, but I don't know how to  make vba respond OK or Cancel .

I tried this but it did not help.
   Set SyncObject = myOlApp.session.SyncObjects.item(1)
   syncobject.stop

Does any guru have any suggestions?
0
Comment
Question by:rberke
  • 4
  • 2
6 Comments
 
LVL 4

Accepted Solution

by:
Smighty earned 500 total points
ID: 38769944
I think you are trying to work around a problem via development when it's better tackled from an administrative point of view.

The dialog pops up under certain circumstances and is - while annoying - mostly not 'incorrect'
Given that you didn't elaborate on your Outlook/Exchange/Sharepoint Infrastructure I will only scratch on the surface:

Outlook connects to shared Calendars, Sharepoint Lists, Public Folders or other opened Mailboxes. Everytime it does that it will check if the User has appropriate rights to all of these items.

There are many more options to check (Exchange Autodiscover; Authentication Methods, etc.)
0
 
LVL 5

Author Comment

by:rberke
ID: 38770287
<<I think you are trying to work around a problem via development when it's better tackled from an administrative point of view.>>

That gives me a good idea. The next time the log box occurs, i will check the event logs.

I agree that solving the problem via development is not the ideal, but administrative options seem limited. I administer our SBS 2003, but we use an ISP for email.  (The SBS 2003 Exchange server was configured, but never used.)


With 3 exceptions, our workstation email is "plain vanilla"

We use an ISP, and we have 5 desktops that connect to the server with "normal" pop3 settings.  

The three "non vanilla" exceptions are.

1. our pop3 accounts are set to leave emails on the ISP server for 5 days.  

2. Several of our computers  have vba program programs that interact with an access database. But, the annoying message occurrs even on computers that don't use vba.

3. the third exception is that we have this unattended "pseudo server" which must run overnight. In fact, it is the ONLY computer in which the "enter network password" causes a problem. All the other users imply click "OK" once or twice a week and things continue normally.  

When I contacted the ISP on this problemt they reviewed my Outlook settings, but found they were all fine. They suggested we change our pop3 settings so that the emails are kept on the ISP server for 1 day.  We tried that for several weeks and messages continued to occur about once or twice a week.  The ISP then suggested we STOP leaving the emails on their server, but we are not willing to do that.

I'll keep my out out for event logs and post whatever I find.  But, it might be a while because the problem only occurs once or twice a week.

rberke
0
 
LVL 5

Author Comment

by:rberke
ID: 38771844
I have a  fairly simple solution, but only because I already have most of the vba code written for other purposes.  If I was starting from scratch, this would be way too complicated.


 I already have a clsSync class module
Pertinent properties are
    Public WithEvents SyncObject As Outlook.SyncObject
    .InProgress boolean which gets turned on and off by inherited methods SyncObject_SyncStart/ SyncObject_SyncEnd
    .LastReceived   date which gets updated by SyncObject_SyncStart  and every time an email is received by NewmailEx  

The class is instantiated with  >>>>> sub application_startup: …….   Set GlobalInstance = new ClsSync

I already use a settimer API so a "monitorSubroutine" is triggered every 5 minutes

I will make the following additional changes to workaround the problem
Sub monitorSubroutine()
…..
    with globalinstance
        if globalinstance.inprogress then
             if now() - GlobalInstance.lastreceived > timevalue("00:20:00" ) then
                  shell(restartoutlook.vbs)
                  application.quit  ‘ this closes outlook,  but the Enter Network Passord dialog remains on the screen
    .....
   End with
End sub


- ----------  RestartOutlook.vbs will have --------------------------
     sleep 20000  ' wait for outlook to close entirely
     taskkill /IM OUTLOOK.EXE /T /F  ' kill Enter Network Password  dialog
     sleep 20000
     shell "C:\Program Files (x86)\Microsoft Office\OFFICE11\OUTLOOK.EXE"
     
I have tested this solution and the only obvious problem is that outlook needs to recover the PST file because it was not closed properly..

------------ conclusion ----------------------------------
While this is simple, it seems a little drastic.  So, I called my ISP again, and they suggested I use Outlook to  modify myIncoming@mydomain.com account so that   “more settings > advanced”  is 5 minutes instead of 1 minute.

I made that change yesterday and will wait a week to see if their idea solves the problem.
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 5

Author Comment

by:rberke
ID: 38771852
I forgot to mention an important point.  I found a simple way to simulate and test the problem.

I change the myIncoming@mydomain.com account so that user name is Xmyincoming@mydomain.com.  Then a manual send/receive will create the Enter User Password dialog.  When I am done testing, I just use the same dialog to remove the X, click OK and everything is back to normal.

Bob
0
 
LVL 4

Expert Comment

by:Smighty
ID: 38796679
The Credential dialog will pop up if you change the Login name, sure. But apart from that I can't grasp exactly why you're getting the dialog in the first place.

You seem to use POP for retrieving mail - which is fine. The retreive intervall could be a problem, but I haven't got it with Outlook in years now with POP3...

the only explanation I do have, is that somehow over night, your connection to the internet is interrupted...
0
 
LVL 5

Author Comment

by:rberke
ID: 38799240
We had the problem almost daily until I changed the retrieval interval from 1 minute to 5 minutes.  In the following 5 days we did not have the problem at all, so I think that was the issue.  

This means your original answer that it was an Administrative problem seems to be the correct answer.

Of course, I don't understand exactly WHY it was an issue, but I don't really care as long as I have a solution.  

But, it might be related to the fact that the email account being downloaded to the server is ALSO being downloaded at night by the boss's computer  (as part of his ongoing monitoring of our incoming email).  Theoretically, if the boss gets an email that takes over a minute to download, the server might have to wait for the boss's download to finish.  

In any case, it is time to close this problem.  Thank you for your effort.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
In-place Upgrading Dirsync to Azure AD Connect
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question