Code Execution Has Been Interupted

L

Luke Bailey

Hello,

I have several Excel Templates that open on automated PC using scheduled
tasks. The templates run through a series of code. The templates all work
fine on my laptop. However, they are often times running into a "Code
Execution Has Been Interrupted" error on my desktop PC running the scheduled
tasks. There is nothing wrong in the code (runs fine from other PC's).
Keystrokes are not entered on the desktop that would stop execution of the
code, I have checked References.... Can't find anything wrong. Furthermore,
the code execution stops at different places in the same workbook. It's
being interupted at places like a "DOEVENTS" statement or an ".end with"
where you don't normally expect any problem. I have found a fix to be
(sometimes) to copy all code out to Word. Remove code from original temlate,
then insert new modules and paste the code. This solves the problem
sometime. Sometimes not. I've also found Dave Bovey's Code Cleaner to do a
great job. My question is, can anyone tell me why this occurs? And are
there any other recommended solutions?
 
J

JLGWhiz

If you have run a disc clean up and defrag recently, I would not know what
else to do. It is usually either a memory problem or a disc space problem or
a combination thereof. The compiler can't find enough room to manipulate.
 
M

michael.beckinsale

Hi Luke,

I know that this might sound like an over simplification but l have
had similiar problems in the past which l have found to be the result
of over zealous use of the 'esc' key to interupt your VBA code.

The keystrokes are retained in memory so when you reset your project
it will fail again & again until all the 'esc' are used. This can
usually be overcome by rebooting your PC. Closing Excel does not do
it.

I have also occasionally found that my desktop PC keyboard ends up
with sticky keys (odd bit of food in it etc) and if this is the 'esc'
key the problem you describe manifests itself.

Hope this is of use to you. As l say l have had this problem exactly
as described and it took me ages to detect.

Regards

Michael Beckinsale
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top