From: wanderez on
I re-installed code and restarted the system. Now the macro is running without any hitch.



ksurvel wrote:

"Code Execution has been Interrupted" message appears randomly
29-May-07

I've encountered this in various versions of Word (2002, 2003, and 2007) when
running macros.

When the problem occurs, running any macro, no matter how simple, will cause
the message "Code execution has been interrupted" to appear, as if you had
pressed CTRL-BREAK. It will continue to occur throughout the macro, at random
points. If you click "Continue," it will run a little bit more, then break
again. If you click "Break," you will see that execution has stopped on some
random line. I've made several test macros with stuff like "if 1 = 1" that
(presumably) can't fail, yet it will break on those lines as well.

I have tried "clear all breakpoints" in the VBA editor.

I've tried the usual troubleshooting methods: deleting normal.dot, removing
any add-ins, running a detect & repair, etc. No joy with any of them.

I've had limited success with rebooting the computer - but it is not a
sure-fire fix, as it will resolve the problem on some machines but not
others. I suspect that it is just coincidental that rebooting and the problem
going away happen at the same time - or there may be something else going on
that I can't localize.

I cannot cause the problem to occur on demand (I know this makes it really,
really hard to troubleshoot.)

I've exhausted all the troubleshooting steps I can think of. Does anyone
have any suggestions?

Previous Posts In This Thread:

On Tuesday, May 29, 2007 9:48 AM
ksurvel wrote:

"Code Execution has been Interrupted" message appears randomly
I've encountered this in various versions of Word (2002, 2003, and 2007) when
running macros.

When the problem occurs, running any macro, no matter how simple, will cause
the message "Code execution has been interrupted" to appear, as if you had
pressed CTRL-BREAK. It will continue to occur throughout the macro, at random
points. If you click "Continue," it will run a little bit more, then break
again. If you click "Break," you will see that execution has stopped on some
random line. I've made several test macros with stuff like "if 1 = 1" that
(presumably) can't fail, yet it will break on those lines as well.

I have tried "clear all breakpoints" in the VBA editor.

I've tried the usual troubleshooting methods: deleting normal.dot, removing
any add-ins, running a detect & repair, etc. No joy with any of them.

I've had limited success with rebooting the computer - but it is not a
sure-fire fix, as it will resolve the problem on some machines but not
others. I suspect that it is just coincidental that rebooting and the problem
going away happen at the same time - or there may be something else going on
that I can't localize.

I cannot cause the problem to occur on demand (I know this makes it really,
really hard to troubleshoot.)

I've exhausted all the troubleshooting steps I can think of. Does anyone
have any suggestions?

On Tuesday, May 29, 2007 11:51 AM
Jean-Guy Marcil wrote:

Re: "Code Execution has been Interrupted" message appears randomly
ksurvell was telling us:
ksurvell nous racontait que :


Where are those macros stored? (Which template)

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE(a)CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

On Tuesday, May 29, 2007 12:06 PM
ksurvel wrote:

Re: "Code Execution has been Interrupted" message appears randomly
"Jean-Guy Marcil" wrote:


The errors occur regardless of where the macros are stored; in normal.dot,
in the currently-open document, in an add-in.

On Tuesday, May 29, 2007 12:41 PM
Perry wrote:

Re: "Code Execution has been Interrupted" message appears randomly
Time to do some cleanups in both templates and VBA projects
http://word.mvps.org/FAQs/MacrosVBA/TemplateBloat.htm

and google around on VBA Code Cleaners to get you tools
to clean up VBA code.

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE



"ksurvell" <ksurvell(a)discussions.microsoft.com> schreef in bericht
news:23BE27D2-AF46-4E7C-9EEA-4F9947C5123E(a)microsoft.com...

On Tuesday, May 29, 2007 1:02 PM
ksurvel wrote:

I've read this (and other) articles on the MVPS website before.
I've read this (and other) articles on the MVPS website before. I've had no
luck with "code cleaners." The problem occurs even if I delete the
"normal.dot" template and let Word re-create it, and if I remove all
templates & add-ins, and then create a new, blank Word document, put a few
lines of macro code in, and try to run it. In that case, what would I clean -
the unsaved blank document with the new code in it?

"Perry" wrote:

On Tuesday, May 29, 2007 1:26 PM
Jean-Guy Marcil wrote:

Re: "Code Execution has been Interrupted" message appears randomly
ksurvell was telling us:
ksurvell nous racontait que :


And when you performed that blank document test, had you ensured that no
other third-party add-in(s) was(were) also running at the time you executed
the test?

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE(a)CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

On Tuesday, May 29, 2007 1:48 PM
ksurvel wrote:

Yes. All add-ins were removed and normal.
Yes. All add-ins were removed and normal.dot had just been re-created (by
Word).

"Jean-Guy Marcil" wrote:

On Tuesday, May 29, 2007 3:09 PM
Jean-Guy Marcil wrote:

Re: "Code Execution has been Interrupted" message appears randomly
ksurvell was telling us:
ksurvell nous racontait que :


In your original post, you wrote:

"I've had limited success with rebooting the computer - but it is not a
sure-fire fix, as it will resolve the problem on some machines but not
others."

Have you tested these new templates created while only normal.dot was active
(and not other add-ins at all) on other machines?
Did you still get the same error message?


--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE(a)CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

On Tuesday, May 29, 2007 3:30 PM
ksurvel wrote:

I'm not necessarily creating templates here - in fact, in most cases I am not
I'm not necessarily creating templates here - in fact, in most cases I am not
creating templates at all. I'm saving into what is now called a "macro
enabled document." So, they are just documents that contain macros - not
templates or anything special.

On one computer, if the problem occurs, I shut down completely & reboot, and
when I try to run macros again, the problem does not occur. This happens
*without* having to clear normal.dot or remove any of the (several) add-ins
that are on that computer. However, on others, even if I remove all add-ins,
delete normal.dot, and then reboot, the problem will re-occur even if I just
open a blank Word document and write a simple macro.

"Jean-Guy Marcil" wrote:

On Tuesday, May 29, 2007 3:49 PM
Jean-Guy Marcil wrote:

Re: "Code Execution has been Interrupted" message appears randomly
ksurvell was telling us:
ksurvell nous racontait que :


Does this means that this behaviour is observable only on Word 2007?


You have mentioned observing this behaviour on many computers.
Are these computers all part of the same network, hence all configured in
the same way?
Or are these computers all totally unrelated machines, each configured in a
different and unique way across many Word versions?

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE(a)CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

On Tuesday, May 29, 2007 4:33 PM
ksurvel wrote:

Re: "Code Execution has been Interrupted" message appears randomly
"Jean-Guy Marcil" wrote:


No, the behavior has been observed in both Word 2003 and Word 2007, with
both old-style Word 97-2003 format documents, as well as Word 2007 "macro
enabled documents" (*.docm).


They are on unrelated machines - the only common factor is that they are
using macros in some way.

On Tuesday, May 29, 2007 10:16 PM
Jean-Guy Marcil wrote:

Re: "Code Execution has been Interrupted" message appears randomly
ksurvell was telling us:
ksurvell nous racontait que :


Then I do not know what to say anymore...

If you observed this error message on unrelated machines, using various Word
versions, even after uninstalling all add-ins and recreating Normal.dot...
Then there is some black spell that was cast on you... I have never seen
this message regularly, only at occasion when I did something wrong or had
a corrupt template, and I have never heard of such a situation where one
individual witnesses the same error message on unrelated machines....

Or else, there is something else under the hood you haven't noticed or
forgot to tell us...

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE(a)CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

On Wednesday, May 30, 2007 2:17 AM
Russ wrote:

Are we overlooking the obvious answer, it's a macro virus?
Are we overlooking the obvious answer, it's a macro virus?
It may be corrupting the Word application to self impose a disable of
running macros.
Is the heritage of the macros being used known?
Are they stored in the "ThisDocument" module or was a new module other than
the "ThisDocument" module used to store the macros in the document?


--
Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

On Wednesday, May 30, 2007 4:21 AM
Jean-Guy Marcil wrote:

Re: "Code Execution has been Interrupted" message appears randomly
Russ was telling us:
Russ nous racontait que :


I doubt it, unless he is not telling the whole story.
See a few replies up the thread when he stated:

"I've read this (and other) articles on the MVPS website before. I've had no
luck with "code cleaners." The problem occurs even if I delete the
"normal.dot" template and let Word re-create it, and if I remove all
templates & add-ins, and then create a new, blank Word document, put a few
lines of macro code in, and try to run it. In that case, what would I
clean -
the unsaved blank document with the new code in it?"


--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE(a)CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

On Wednesday, May 30, 2007 6:25 AM
Russ wrote:

Re: "Code Execution has been Interrupted" message appears randomly
Another one of his statements was:

The only common factors among his various machines and various versions of
Word would appear to be the running of macros and his network, if they are
connected, which makes it seem like a virus. Maybe a anti-virus program
could fix it, but all Word apps or certain Word .dlls on his network might
be corrupted.
On networks, is there one master watchdog (Policy Service?) that handles
macro security?
Maybe that watchdog, if it exists, is corrupted because that would also
explain multiple versions and machines having the same problem.


--
Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

On Wednesday, May 30, 2007 12:00 PM
ksurvel wrote:

I suspected a macro virus as well, but the systems are not physically
I suspected a macro virus as well, but the systems are not physically
connected, and they use different anti-virus programs (I've seen the symptoms
on computers running Norton, McAffee, and AVG).

The only commonality is that the computers in question are opening a
document that contains macros. (Actually, a set of documents that all contain
macros, in both ThisDocument and in modules.)

I've run code cleaners on the documents themselves, wondering if they've
become corrupted somehow, but I cannot tie it down to one document - and once
the problem occurs, it occurs no matter what document is opened. And again,
I've deleted normal.dot, and removed all add-ins, so... ?

"Russ" wrote:

On Wednesday, May 30, 2007 12:01 PM
Jean-Guy Marcil wrote:

Re: "Code Execution has been Interrupted" message appears randomly
Russ was telling us:
Russ nous racontait que :


Ah, yes, he did not write that all the different computers he had tested
where on the same network, but that is definitely a possibility.

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE(a)CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

On Wednesday, January 21, 2009 4:47 PM
paolo ruffini wrote:

code execution has been interrupted
We have observed this behavior in MS Excel 2003 as well. Macros break in random spots for no apparent reasons.


Submitted via EggHeadCafe - Software Developer Portal of Choice
BizTalk Repeating Structures Table Looping and Table Extract
http://www.eggheadcafe.com/tutorials/aspnet/73bf7539-4c13-43a5-a580-a5704fe31a76/biztalk-repeating-structu.aspx
From: Suresh on
Put this as the first statement in your code:
Application.EnableCancelKey = xlDisabled (For Excel)
Application.EnableCancelKey = wdCancelDisabled (For Word)
Now u won't get the interruption message.



wanderez ici wrote:

"Code Execution has been Interrupted"
13-Apr-10

I re-installed code and restarted the system. Now the macro is running without any hitch.

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
BizTalk: Conditional looping incorporating the Greater Than functoid.
http://www.eggheadcafe.com/tutorials/aspnet/e4334816-d106-40f2-812d-043c18df964c/biztalk-conditional-loop.aspx