More Outlook Resource Sites

Microsoft Developer Network (MSDN)

FAQs and other general resources

Troubleshooting Outlook VBA

Sometimes Outlook VBA won't run. Likely causes include macro security settings, missing or disabled components, or external programs starting Outlook and holding it open. This page aims to present the most common causes and solutions.

Macro Security

The most common cause of VBA code not running is the macro security setting. The default setting does not allow any Outlook VBA code to run. For instructions on how to change the setting and test whether VBA is working, see:

I recommend that most people use Medium in Outlook 2003 or Warnings for all macros in Outlook 2007, because that ensures that you'll get a prompt, which will let you know that Outlook VBA has loaded. You can use the next higher macro security setting if you sign your VBA project with the Selfcert.exe tool that comes with Office; see Writing VBA Code for Microsoft Outlook for details.

If you choose Very High (available in Outlook 2003 only) Outlook VBA macros will not run, since Outlook 2003 has no default "trusted location."

These articles from the Office Resource Kit explain macro security in detail:

Outlook Held Open

If the macro security dialog doesn't open or if Alt+F11 does not open the VBA window, you may have a different problem: VBA itself isn't loading. One possible cause is that another program is starting Outlook without any user interface and, when the user starts Outlook's UI, most  COM add-ins -- including the VBA environment -- won't start up.

To troubleshoot, shut down Outlook and wait a few minutes. Use Ctrl+Alt+Delete to display the Task Manager and make sure that Outlook.exe is no longer running. If it is, you almost certainly have a program holding Outlook open; use the Task Manager to stop Outlook. Then quit or disable any anti-virus, anti-spam, fax, or PDA synchronization utilities. (You may want to disconnect from the Internet during this phase of the troubleshooting.) Restart Outlook and try to get into VBA. If it works, then quit Outlook and restart one of the utilities you turned off. Restart Outlook to see if VBA runs OK. Repeat with the other utilities. If you find one that makes it impossible to start VBA, you may need to start Outlook before you run that utility. Make sure that such a utility is not set to start when Windows starts, so you can start it after you run Outlook.

VBA Not Trusted

Outlook supports, but does not normally set a DontTrustInstalledFiles registry value that controls whether COM add-ins are trusted. VBA itself is a COM add-in, so if DontTrustInstalledFiles is set to 1 and macro security is set to High, no COM add-ins run, including VBA.

In Outlook 2003, you can also control this option with the Tools | Macro | Security dialog, on the Trusted Publishers tab, using the Trust all installed add-ins and templates check box.

Other Possible Causes

VBA is part of a default Outlook installation, but in a custom installation, it can be omitted or disabled. Try rerunning Office or Outlook setup and, under Office Shared Features, make sure that the VBA and Visual Basic Help components are installed.

If you still can't find the cause, try creating a new Windows user profile. That will provide a clue as to whether the issue is with the installation or with the particular user's settings.

More Information