Forum Discussion
Excel shutdown when a macro is running
I experience the same after the last MS update. Certain macros that had been running perfectly for years were now causing a crash.
My first thought was that the update didn't install properly so I restored an image from a backup. The macros worked fine. After the MS update reinstalled itself Excel would crash again.
Next I ran the macro in edit mode, using the F8 key to step through it. Everything went smoothly, indicating that there wasn't enough time between lines of instruction.
I next isolated which step was causing the crash when the macro was executed in normal mode. I did this by removing steps, then running the macro again until I identified where Excel crashed.
I then interjected a time delay statement before the code that caused the crash:
Application.Wait (Now + TimeValue("0:00:10"))
Problem solved!