"code execution has been interrupted " message

cray

New Member
Joined
Aug 24, 2007
Messages
2
Macros that used to work under Excel 2000 are under Excel 2002 SP3 (Windows XP Pro) producing the above message at random in different macros and or workbooks. It is as though I have pressed Cntr Break and I have not and no break points etc have been set. If I click on continue the macro continues to operate and again the message can appear apparently at random. I think it could be associated with memory as excel reports 85% of memory used. (3GHZ processor 1G ram) any help appreciated !


Thanks
Cliff
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
cray,

I know this isn't much help, but you may need to check that all the functions you're using from your 2k macros still exist in their same form in your excel 2002. MS often has a list of changes to the vba system with upgrades.

robert phillips
 
Upvote 0
Sorry just thought of something else,

Did you try uninstalling SP3? There may be other system components affecting vba or excel due to component/dll version issues.... Maybe uninstall/reinstall sp3 and test again. Not pretty, but I've had that happen with other M$ updates....

robert phillips
 
Upvote 0
Code Execution has been interrupted

Sorry just thought of something else,

Did you try uninstalling SP3? There may be other system components affecting vba or excel due to component/dll version issues.... Maybe uninstall/reinstall sp3 and test again. Not pretty, but I've had that happen with other M$ updates....

robert phillips
The compiler does to alert me to any errors so I assume the upgraded Excel VBA is compatable. It's a business machine and I am not allowed to uninstall softwate . Our local IT support eont touch this problem.
 
Upvote 0
I've been having this same problem with many macros I create. I just fixed it today (fingers crossed). Try putting this in the first line of your macro.

Application.EnableCancelKey = xlDisabled


You won't be able to use the Esc key but just ctrlaltdel to break. So far, its fixed my random "code execution.." errors.
 
Upvote 0
I just started getting this today after installing Visual Studio 2005 on a Vista computer. Whole bunch of my excel macros throw this message up at some program lines. I don't see the pattern to it yet.

Adding the "Application.EnableCancelKey = xlDisabled" line (mentioned above) fixes it.

Seems like a noxious bug.
 
Upvote 0
Forgot to mention

The macros that broke after I installed Visual Studio 2005 (plus patching it fully) all worked on the same Vista computer a few days ago *before* installing Visual Studio.

Unfortunately, removing Visual Studio did not undo the damage....
 
Upvote 0
Should we re-enable the CancelKey at the end of the Macro?

Application.EnableCancelKey = xlDisabled

Application.EnableCancelKey = xlEnabled?
 
Upvote 0
the three options for Application.EnableCancelKey are:
xlDisabled -> which ignores pressed keys and solves the problem
xlInterrupt -> which sets the error handleing back to Excel's control
xlErrorHandler -> wich makes error go to your error handleing section

When the macro finishes, the setting will be reset to it's default (even if you don't specify) so there is no need to change the setting back unless you want to re-enable user breaking during part of the macro run.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,729
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top