HELP!!! "Code execution has been interrupted"

x-amount

Active Member
Joined
May 16, 2003
Messages
260
But I havent pressed anything!!!

There is definite problem, as the "Code execution has been interrupted" error message appears seemingly at random (although if the workbook doesnt change it is the same points), and for no reason.

If I click the continue button the macro runs exactly as planned, but still there seems to be no rhyme or reason as to why this happens!?

It even invokes on the workboon_open function.

Any ideas???
 
Thank you...It helped me trough too...Besides that I had to switch the Application.EnableEvents to True (but somewhere in my code is the switch on/off of this feature), mybe it was 'interupted' at a bad time...
 
Upvote 0

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Setting Application.EnableCancelKey = xlDisabled worked for me. However, I still wanted to allow the user to quit the program by pressing [esc] or break into the code with ctrl+break. So, in case there are others out there like me, I figured I would add my two cents to this discussion.

I noticed that after adding 'Application.EnableCancelKey = xlDisabled' to my code, running it, and then removing it, I no longer got the error message.

So, if you don't want to disable the cancel key, but cant get around this problem, try disabling it and then immediately re-enabling it.

Application.EnableCancelKey = xlDisabled
Application.EnableCancelKey = xlInterrupt

It is working for me, but I also don't get the error anymore, even if I completely remove the code to disable the cancel key.

Maybe it will work for someone else. Good luck!
 
Upvote 0
Page 4: Akfrost wrote: and this works

The simple thing that seemed to fix the issue for me... When the code is interrupted... Click to debug the code and then hit ctrl + break.

When you run the code again, it will work fine. Hopefully this will work for others as well.
 
Upvote 0
<TABLE class=tborder id=post2702299 cellSpacing=0 cellPadding=6 width="100%" align=center border=0><TBODY><TR vAlign=top><TD class=alt2 style="BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 0px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-BOTTOM: #ffffff 0px solid" width=175>The post from 'Ed in Aus' Works
Post #54

Weird how this works?


Ed in Aus******** type=text/javascript> vbmenu_register("postmenu_2702299", true); *********>
Board Regular

Join Date: Jul 2007
Location: Australia, NSW
Posts: 813


</TD><TD class=alt1 id=td_post_2702299 style="BORDER-RIGHT: #ffffff 1px solid"><!-- report button -->




http://www.mrexcel.com/forum/report.php?p=2702299
<!-- / report button --><!-- icon and title -->



icon1.gif
Re: HELP!!! "Code execution has been interrupted"
<HR style="COLOR: #ffffff; BACKGROUND-COLOR: #ffffff" SIZE=1><!-- / icon and title --><!-- message -->Page 4: Akfrost wrote: and this works

The simple thing that seemed to fix the issue for me... When the code is interrupted... Click to debug the code and then hit ctrl + break.

When you run the code again, it will work fine. Hopefully this will work for others as well.
</TD></TR></TBODY></TABLE>
 
Upvote 0
How the heck you figure this out?



Page 4: Akfrost wrote: and this works

The simple thing that seemed to fix the issue for me... When the code is interrupted... Click to debug the code and then hit ctrl + break.

When you run the code again, it will work fine. Hopefully this will work for others as well.
 
Upvote 0
Solution:

This is an excel glitch that happens if you hit ctrl-break while in break mode. To fix, just run your code, when it says interrupted, hit debug, and hit ctrl-break in break mode. Then play (F5). Doing so both starts and stops the glitch.
 
Upvote 0

Forum statistics

Threads
1,216,179
Messages
6,129,336
Members
449,503
Latest member
glennfandango

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