• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA is causing Excel file to "Not Respond" - can the VBA be edited outside Excel?

David Evans

Active Member
I saved some bad code and it's causing Excel to hang on opening a particualr file - I've tried shutting down the macros, holding Shift when I open the file etc ...

Anyone got any bright ideas on how I can get into the VBA editor for an Excel file without opening the file?
 
If it's a 2007+ file:

Create a new file (I'll call it test). Write a simple macro to it like:
Code:
Sub Test()
MsgBox "Hi"
End Sub

Save file as an xlsm.

Make a backup copy of your buggy file (just to be safe).
Change the extension of Test.xlsm and BuggyFile.xlsm to zip, i.e.
Test.zip
BuggyFile.zip

Open both the zip files. Under xl folder, find the vbaProject.bin
upload_2015-4-27_14-32-50.png

Copy the bin file from BuggyFile.zip to Test.zip, over-writing the existing file. Close the Zip files. Rename Test.zip to Test.xlsm.
Open the Test file.
You should now have all the VB code available for edit. When you get the code correct/debugged, reverse the process.
 
Thanks Luke - greatly appreciate your solution - will go and try it - have communicated via PP - have a beer on me ... Thanks!
 
Back
Top