I had a horrific Excel 2003 crash today. When I restarted Excel and opened any workbooks – including locked xla’s – which had been open during the crash, I found that they were riddled with phantom breakpoints. I’ve seen the occasional phantom breakpoint before, but never on this scale.
So what is a phantom breakpoint? A phantom breakpoint is a term people use to describe a situation where they try to run some code and, for no apparent reason, code execution pauses when a certain line is reached – just as it would if you had placed a breakpoint there. The pause in code execution is accompanied by the message “code execution has been interrupted”. When you press F5 to continue code execution, it will happily finish without any complaints (unless it hits another phantom breakpoint). My understanding from participating on online MS Office forums is that phantom breakpoints are more common in MS Access than in MS Excel.
In the past, the reliable fix I’ve used to get rid of the phantom breakpoints is to press CTRL+BREAK. Another less than ideal option is to put
Application.EnableCancelKey = xlDisabled at the start of the problematic procedure. My usual solution didn’t work in this case so I tried a whole host of things including clearing xlb files, running Code Cleaner, pressing CTRL+SHIFT+F9 as suggested here and various other tweaks – all to no avail.
I also have Excel 2007 installed on the same box and I found that the workbooks had the same problem when I opened them in that. In the end I rebooted my PC and the problem disappeared, so the cause must be a temporary file which is communal across versions. Any ideas?