Reputation: 195
I am unable to open xml
workbook because there is an code by the name of workbook_open
or Auto_open
which runs on opening the workbook.
Is there a way I can recover the code from my workbook?
Microsoft Excel asks for whether to wait for the program to retstart, close the program.
Upvotes: 2
Views: 120
Reputation: 1403
I'm assuming that your workbook_open
has a code that somehow closes the file or destroys it in some way. What you can do is clear trusted documents with the following steps.
In excel go to file > options > trust center > trust center settings > trusted documents
Then clear all trusted documents.
The next time when you open your workbook macros will not be enabled by default, so the workbook_open
will not be triggered so instead of enabling it simply view the macros by pressing alt+F11
Upvotes: 1
Reputation: 3391
Rename the workbook then open it.
Don't allow / enable macros when the security dialogue pops up.
Press Alt + F11 to enter the VBA IDE.
In the project explorer find your project.
Find your worksheet in the project explorer, double click on it.
Delete any code there and save.
Upvotes: 0