简体   繁体   中英

Recover from fatal error in excel VBA Workbook_Open?

I stumbled on a way to crash excel in Workbook_Open while making an .xla It's still a toy project, so I've been able to just delete it and start over (and now I'm coming back with version control and baby steps.)

However, assuming I didn't have those options, how would I possibly edit the .xla remove the fatal code, since I have to load it to edit, and loading it crashes the editing environment?

This isn't exactly what you are looking for. But some advice during development.

I always work on my xla files as xls files until they are stable. That way if it isn't stable, I can just not enable macros on opening, and fix the problem, then close and reopen with macros enabled.

--EDIT--

I did some more research, because I was curious and because I remembered hearing about disabling macros on startup. Here is a link that says you can hold 'Ctrl' while Excel is starting, to start in Safe Mode. There is a bit of other information that is worth a read to see if it applies.

http://support.microsoft.com/kb/826922

--EDIT 2-- Another link that says holding 'Shift' might also do the trick

http://www.mrexcel.com/forum/showthread.php?t=348351

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM