The macro name.ThisOutlookSession.DisplayMyForm cannot be found.

  • Thread starter Thread starter Mitch
  • Start date Start date
M

Mitch

So from time to time I run into this error, I click the macro button that was
created and get this error. If I close OUTLOOK 2003 sp3 and restart it may
work 4/5 times.. this has occured to 2 other systems for the same macro.

If I load the macro editor (Alt+F11), it does nothing.

Any suggestions would be greatly appreciated.

This is the code for the button

Public Sub DisplayMyForm()
TrainForm.Show vbModaless
End Sub


Odd thing is when I went to current Macro's it found none (Trying to edit /
look at the button). Restart Outlook and now it works. It's as if it totally
missed loading the macros from the start.
 
It's not a bad idea to include some code in the Application_Startup event
handler in ThisOutlookSession, just to give VBA a little nudge to load. It
can be as simple as a Debug.Print statement.
 
Your guess may be on the right track: If another application starts Outlook
without UI, VBA may not load. If you shut down and restart Outlook, use the
Windows Task Manager to make sure outlook.exe has completely shut down before
restarting.
 
Back
Top