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???
 
Hmmmm, interesting tricks. i will try

i dont declare variables, and although so far my codes worked, I had problems before when trying to use Option Explicit without knowin what it does and again, yesterday, i ran Option Explicit and it took me to this thread :)

Brief code will not have defects, random errors generated at random times, sometimes they didnt, it has somethin to do with declaring workbooks/files, i remeber two things, usually auto-break would happen around set statements or endif's! basically i suggest to not use option explicit if you've never declared variables but you will probably get to this page after you already have done so, way out - like the gurus suggest
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
suddenly the rotation of workbooks haults, Microsoft Visual Basic window, end if highlighted, no breakpoint!! :eek: what is goingz on?! the shockvalue is too high, ninepointfive outta ten, just don't loose touch with reality
 
Upvote 0
Rotation of Workbooks? :confused:

This thread has to do with a very specific Error that is occurring, and not the one you are experiencing or talking about. Check the Error Description. ;)

The original subject of this thread has nothing to do Option Explicit and or Variable declaration, which you should learn how to do, and you should do, whether the code is long or short.

You should also use a debugging compiler, before running code.

This sounds like a corruption issue, all together different than what you're talking about.

And, if you're experiencing a problem with this, please start a new thread. I can't tell if you're giving advice for the wrong problem, or are experiencing a problem, yourself... Thank you. :)
 
Upvote 0
Alright but im bettin my coins that Option Explicit is the reason for the "Code execution has been interrupted" message, i experienced this message and it was a trip, i found that removing it worked for me
 
Upvote 0
Please post your code where Option Explicit causes the error message: "Code execution has been interrupted"

I would like to replicate what you're talking about. :confused:

Telling someone to remove Option Explicit is really bad advice. Learn how to declare your variables properly, and compile your code. :p
 
Upvote 0
"Code execution has been interrupted"

Hi
I always declare variables, but tried not using Option Explicit.
Still doesn't work, and code still gets interupted.
Has there been any further progress since last December?
Regards
Jean-Louis
 
Upvote 0
Hi JLF,
i now declare all variables and use option explicit, still i rarely get this error.

All it takes is to reboot and resume, the error goes away>>
 
Upvote 0
Thanks for reply.
I think there were issues with corrupted dll's. Found various other instances on web where people faced similar problems.
Was definitely not option explicit causing it.
In end was just easier re-installing MS Office and now it works.
Regards
Jean-Louis
 
Upvote 0
This worked for me...

'Sub...
Application.EnableCancelKey = XlEnableCancelKey.xlDisabled
'Code...
Application.EnableCancelKey = XlEnableCancelKey.xlInterrupt
'End Sub
 
Upvote 0

Forum statistics

Threads
1,216,182
Messages
6,129,357
Members
449,506
Latest member
nomvula

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