Posts Tagged ‘excel’
code execution has been interrupted
After running my macro like this:
set apExcel = CreateObject(“Excel.Application”)
set wkBook = apExcel.Workbooks.Add (“C:\SpreadSheet.xls”)
apExcel.run “A_Macro”
wkBook.Close
apExcel.Quit
It stopped with the message “code execution has been interrupted” next time I ran it in Excel on my desktop. I’d not seen this message before. Clicking ‘Continue’ worked the macro executed that line of code and many more until it got back to that line later, then the message appeared again. About four lines exhibited the problem, I recognised them as lines I had se breaks on during development. I have occasionally experienced a problem where breaks don’t actually leave the code, even though the markers do. So I hit F9 twice – to set and unset the breakpoint – to no effect. I tried ‘clear all breakpoints’ – to no effect.
I found a solution here, which seems to have worked. The entry is Oct 13th, 2009, 02:35 PM, by akforsyt. IT is simple to go into debug and press Ctrl+break.