"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
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

robert phillips

New Member
Joined
Sep 15, 2007
Messages
43
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
 

robert phillips

New Member
Joined
Sep 15, 2007
Messages
43
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
 

cray

New Member
Joined
Aug 24, 2007
Messages
2
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.
 

Jsmooth65

New Member
Joined
Oct 1, 2007
Messages
1

ADVERTISEMENT

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.
 

lneer

New Member
Joined
Oct 8, 2007
Messages
2
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.
 

lneer

New Member
Joined
Oct 8, 2007
Messages
2

ADVERTISEMENT

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....
 

ejs7597

New Member
Joined
Sep 25, 2006
Messages
35
Should we re-enable the CancelKey at the end of the Macro?

Application.EnableCancelKey = xlDisabled

Application.EnableCancelKey = xlEnabled?
 

XL Merrill

New Member
Joined
Feb 13, 2008
Messages
1
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.
 

jimv

New Member
Joined
Feb 12, 2008
Messages
46
XL,
Thanks for that code. I too have been having same problem and this fixed it.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,182
Messages
5,594,727
Members
413,927
Latest member
PolAmer

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
Top