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):



  1. Open a new Excel workbook, not the failed workbook
  2. Go to the Developer tab and click Macro Security in the Code section of the ribbon
  3. Click on the marker "Disable all macros with notification"
  4. Click the Trusted Locations tab on the left and check the Disable all Trusted Locations checkbox at the bottom
  5. ... Go to the "Trusted Documents" section and check the "Disable all trusted documents" checkbox.
  6. Click OK and close the new workbook
  7. Open the Excel file that was crashing
  8. Don't click Enable Macros - instead go to the Developer tab and open the Visual Basic Editor
  9. In the VB editor save the project and click Debug> Compile VBAProject
  10. ... Fix any compilation errors that occur
  11. Save VB project again and then save Excel workbook
  12. Revert all changes made to Macro Security in steps 3-5.
  13. Close Excel, reopen the previously failed workbook and enable macros
+8


source


THANK YOU VERY MUCH. I had a rather large file with months of coding that I thought I would have to do when I do this. Your advice worked. I am very grateful.



0


source


@ puzzlepiece87

I know this is an old thread, but it was very helpful for me to solve the very problem described today.

thank

-1


source







All Articles