Microsoft VB error "Code Execution has been interrupted"

Post Reply
User avatar
Chengooi
Posts: 64
Joined: Tue Jan 13, 2009 7:46 am
OLAP Product: TM1
Version: 9.4
Excel Version: 2003
Location: Auckland, New Zealand
Contact:

Microsoft VB error "Code Execution has been interrupted"

Post by Chengooi »

Some spreadsheets with no macro but with lots of TM1 link formulas on it, when the spreadsheet get refreshed, the code pop up and the debug tab was grey out. leaving continue and end tab.

To get out from it user simply select end but it did not actually fixed it as it pop up again and again until the sheet was closed off and at times restart excel again and sometimes worse required to re-start computer to get rid of it.

Has anyone got any clue why and how to fix it? :geek:
Last edited by Chengooi on Thu Jan 15, 2009 7:34 am, edited 1 time in total.
The most wasted of all days is one without laughter.
e e cummings (1894-1962)
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Microsoft VB error "Code Execution has been interrupted"

Post by Alan Kirk »

Chengooi wrote:Some spreadsheets with no macro but with lots of TM1 link formulas on it, when the spreadsheet get refreshed, the code pop up and the debug tab was grey out. leaving continue and end tab.
The code doesn't have to be within the workbook itself. The tm1p.xla add-in has VB/A code in it as well, and that's most likely to be where the code interruption occurred rather than in the workbook. The fact that the [Debug] option is greyed out is indicative of this. It doesn't necessarily mean that it IS the tm1p.xla code that's been interrupted, but it does generally mean that it's happening inside a protected VBA project. When you're working with TM1 files, the tm1p.xla file is odds on to be the one.

VBA code can be interrupted by the user hitting [Ctrl] + [Break] or [Esc] unless the code writer has prevented that from happening by assigning the relevant value to the EnableCancelKey property. I don't know whether the Applix coders did that, but probably not. In which case, slap your users' hands if they go anywhere near the keyboard while TM1 is doing its thing.
Chengooi wrote:To get out from it user simply select end
[Continue] may get you a better result, though sometimes not. As a rule of thumb, though, you can't expect to [End] VB/A code and live happily ever after by doing so.
Chengooi wrote:but it did not actually fixed it as it pop up again and again until the sheet was closed off and at times restrat excel again and sometimes worse required to re-start computer to get rid of it.

Has anyone got any clue why and how to fix it? :geek:
Yeah, that can happen sometimes. Other than avoiding pounding the keyboard while a process is running (see above), I don't think that there's any guaranteed way of avoiding it. I had an instance the other day where some custom VBA code stopped because of a known bug in Excel. (The "limit to the number of times you can copy a worksheet" one discussed in http://support.microsoft.com/kb/210684/en-us, the "workaround" for which, incidentally, does NOT work and which they STILL haven't fixed in Excel 2007.) Although the error was handled and exited the code correctly, thereafter whenever I tried to run the code I got the "code has been interrupted" error. Indeed, when I shut down Excel and restarted it, every add-in which ran initialisation code would trigger the same thing. This suggests that something went funky in the VBA library code that was running in the computer's brain, and a restart was the only solution.

Unfortunately the only option is to live with it. I don't find it happening frequently; maybe once every few months.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Post Reply