PDA

View Full Version : Code execution has been interrupted



Divad
03-17-2009, 03:49 AM
I am using Excel 2003. When i run some of my macros, i get an error message saying 'Code execution has been interrupted'. It appears randomly and if i press continue the code carries on running.

I have searched google and many people have had the same problem but i cannot find a definative fix. If you put

Application.EnableCancelKey = XlEnableCancelKey.xlDisabled
infront of the macro it will disbale the error. The problem there is i would need to put that on all my code and i also have some workbooks that i didn't create that have userforms pop up when the workbook opens and the code is password protected, so i cannot enter the code, and cannot open the workbook

This problem is restricted to my machine, all macros that display this error work fine on other machines, so there is nothing wrong with the code.

Has anyone else come accross this and fixed the problem?

Thanks

Bob Phillips
03-17-2009, 03:59 AM
Try downloading and running Rob Bovey's "CodeCleaner" add-in.

Go to http://www.appspro.com, go to the "Free Utilities" page, and click the link to
"Excel VBA Code Cleaner".

Divad
03-17-2009, 04:38 AM
Its not a problem with the code, i also get the error in word. The code runs fine on other machines.

Just wondered if anyone had come accross it and found a definate fix. I understand it could be too complex to sort over a forum but thought i would ask.

Divad
03-17-2009, 08:56 AM
Not sure what the problem was but uninstalling office and reinstalling it fixed the problem.

Thanks

mdmackillop
03-17-2009, 12:01 PM
I've suffered with it, but not so much recently. I never found a real cure.