I had a VBA project in outlook with a few email macros - but after a PC crash they are all gone and all I see is a fresh 'Project1' when I hit Alt+F11
I'm not a VBA programmer, but had a collection of handy macros for email sorting etc. I would not like to have to code them again. Anyone know where the code files should be on the filesystem so that I might rescue the code?
VBA macros are stored in a file that's named VbaProject. OTM. This file is a product storage file and isn't meant for distribution. Outlook doesn't provide a direct means to manage OTM files.
In Excel, VBA code can be stored in three different locations: in a Visual Basic module, in a Visual Basic class module, and "behind" worksheets and workbooks. To edit code "behind" a worksheet or a workbook: Activate the Visual Basic Editor (press ALT+F11).
xlb file or in specific spreadsheets; all Microsoft Outlook macros are stored in one global file in your file system. Specifically, the file storing all you Macros is named VBAProject. otm. The file can be found at: C:\users\<your_user_name>\AppData\Roaming\Microsoft\Outlook.
This page has some really good insight on where Outlook keeps all its stuff. It suggests the following:
All Outlook macros are stored in a single file named VbaProject.otm in the user's %appdata%\Microsoft\Outlook folder, which will be a hidden folder on most systems.
Now, the problem is that if you do not see them now, then you probably won't be able to restore them from that location: there is probably either an "empty" project there or no project at all, but if that folder is being backed up, you might be able to restore it.
Moving forward, you might consider exporting your macros periodically in case this happens again, either through the VBA IDE (right-click and select Export File...) or using one of the tools mentioned in the linked article (like the Office Profile Wizard).
Ok. things to try to fix this...
I assume after the problem occured you tried logging back into the same windows user account, and the same Outlook profile.
If this doesn't work do you remember adding self signing certificate at all? If so have you got a copy of the cert? you can try reinstalling it into the certificate manager (certmgr.msc) copy/install it to the Certficiates - Current User\Personal\Certificates hive.
I just found this note from Sue Mosher (outlook VBA guru): "AFAIK, once an .otm file is corrupted, it can't be recovered. That's why I recommend that people who rely on VBA code export their modules or backup the entire file. "
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With