Excel crashes when opening a trusted document using macros or enabling macros
As the title says, I cannot open the trusted macro document - Excel will crash immediately. Making a copy of the document allows it to be opened (because the copy is not trusted) and I can validate the macros in the VB editor, but enabling the macros causes another crash. Why is this happening and what can I do to fix it?
+5
source to share
3 answers
This is caused by a compilation error. To fix this, use the following steps (all thanks to Alla on Ozgrid , whose directions I slightly adapted for clarity):
- Open a new Excel workbook, not the failed workbook
- Go to the Developer tab and click Macro Security in the Code section of the ribbon
- Click on the marker "Disable all macros with notification"
- Click the Trusted Locations tab on the left and check the Disable all Trusted Locations checkbox at the bottom
- ... Go to the "Trusted Documents" section and check the "Disable all trusted documents" checkbox.
- Click OK and close the new workbook
- Open the Excel file that was crashing
- Don't click Enable Macros - instead go to the Developer tab and open the Visual Basic Editor
- In the VB editor save the project and click Debug> Compile VBAProject
- ... Fix any compilation errors that occur
- Save VB project again and then save Excel workbook
- Revert all changes made to Macro Security in steps 3-5.
- Close Excel, reopen the previously failed workbook and enable macros
+8
source to share