Outlook and “Macros are Disabled” error

One error some people seem to be getting when trying to run macros in Outlook is: “The macros for this project have been disabled.” It then goes on to tell you to review some help that isn’t very helpful.

The scenario is generally the same, you create your macro and it runs fine, you close Outlook and when you re-enter the macros no longer run. Some blogs suggested lowering your security settings, or signing the thing, but I tried both of these to no avail.  

The only way I was able to solve the problem was to follow these steps:

  1. Copy EVERYTHING out of your VB macro project, into a text file. Save the textfile to your drive. 
  2. Close everything, reboot the computer.
  3. Go to your C:\Documents and settings\<yourusernamehere>\Application Data\Microsoft\Outlook folder.
  4. Either delete the file VBAProject.otm, or (better and safer) rename to VBAProject.old or some similar name.
  5. Open Outlook
  6. Reopen the VB Macro editor
  7. Paste in the code from your text file.

After doing the above, I was able to start running the SaveAttachements macro I blogged about yesterday. From my research, no one is really quite sure why this headache occurs, and why this is the only way to fix it, but it does work. 


23 thoughts on “Outlook and “Macros are Disabled” error

  1. I wish I had read this post a little earlier…
    The dig certificate I had used to sign VBAProject.OTM expired on Sat so yesterday I got a new one and re-signed VBAProject.OTM. Apparently, this led to some type of file corruption and now I cannot get access to more than a thousand lines of code I wrote last year (meaning, it’ll take me a while to reproduce them ;-).
    On top of this, I found that the automated online backup system I’m using had decided that VBAProject.OTM is a “cache” file and, therefore, hadn’t bothered to back it up.
    The interesting question for me is whether there is anything I can do to extract my code (or, at least some of it) from VBAProject.OTM… It’s about 200K in size. When opened using the VBA Macro Editor it shows no code. If I open it using Visual Studio in binary mode, I can see my code in there (encoded in the VBA binary format).
    Any ideas? Any docs on the VBA binary format? At this point, I’d feel better writing an app to pull my code out than re-writing the code. Plus, this way I can share it so that others don’t get hit by the same problem.


  2. Simeon,

    I have had a remarkably similar problem. I installed a third-party add-in, and it hosed my VbaProject.otm file. I verified that it was a corrupt file by the “renaming/restarting” Outlook trick.

    Any luck on finding an app to pull out the source code from the OTM file? Pointers would be appreciated, if you have any.



  3. Thank very much for this spot on solution. Sure saved me a lot of time. Things went wrong after upgrading my Office 2000 Pro to a Office XP Pro. Thanks again..!


  4. I did not have to reboot my computer for this to work — I simply shut down Outlook completely, renamed the file, restarted, open VBA, inserted a new Module, pasted my code, saved, and I was all set.

  5. I know what *I* did to break this. My macros were digitally signed, and I deleted the cert without unsigning my macros.

  6. …and simply renaming the file, then re-pasting worked, as Richard suggested. I believe the offense I committed was installing the Microsoft OfficeLabs Email Prioritizer (which so far I see no reason to install).

  7. I was actually getting an Automation Error (440). These macros had been working for a long time with no recent changes but I had recently downloaded an xml editor for evaluation so I figured it must have replaced one of the common dlls. After reinstalling/repairing all of the dlls that my macro project referenced my macros still weren’t working. After reading your article I decided to follow the instructions you posted on the chance that it was actually my project that was hosed. Now all of my macros are working again. Thank you!!!!

  8. Thanks! This worked for me. Unfortunately, every time I restart Outlook, the macros are disabled again.

    Any ideas for a longer term fix?

  9. I found the problem for me to be with the macro security settings. Change the setting under the menu:
    tools->macro->security to medium.

    As Neal said the fix above only seems to work the first time its done.

  10. Try lowering your Macro security all the way, close Outlook, then reopen it. That worked for me. You have to close and reopen it after changing the settings though, or it won’t work.

  11. Thank you for psoting this solution. It worked for me on Windows 7. As mentioned in one of the posts above the file to delete in Windows 7 is located in the user’s AppData\Roaming\Microsoft\Outlook folder.

Leave a Reply to I.Patel Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s