close

Here's the situation..
I had my wwgpe.xls file open.
I played around with it, but never saved.
I opened another Excel session via the Start menu.
Worked in that new Excel session for a while, and saved.
Went back to the wwgpe.xls file and didn't need it so I clicked the X
at top right.
Received q if I wanted to save.
Responded No.

I then received the quot;Code execution has been interruptedquot; problem.
This doesn't seem to be happening for all users on their machines. Is
there any possible fix for this?--
LAF
------------------------------------------------------------------------
LAF's Profile: www.excelforum.com/member.php...foamp;userid=9656
View this thread: www.excelforum.com/showthread...hreadid=498175This is a huge problem for which nobody on the net has clue about - I have thoroughly searched for answers. I have had this problem for quite a while. There are a few options:

1. If the code is corrupt the code cleaner will work - not in your case though.
2. Rebooting PC sometimes work, but problem comes back.
3. Corruption is probbably in your user profile. I have tested this and it works. When you create a new Windows user profile the problem should dissapear. You can then copy your old profile settings over. This problem is seen in Word as well, I think even Acces.

Your code has nothing to do with your problem. Even if you just create a simple endless loop in a new sub, the problem will occur:

I hope this info will help you.

Do
Loop
Another solution is this:

WaitTime=30
Tyd = Timer
On Error GoTo HandleCancel 'trap errors of Cancel bug
Application.EnableCancelKey = xlErrorHandler-------------Your main codeExit Sub
HandleCancel:
If Err = 18 Then If Timer - Tyd gt; WaitTime Then Answer = MsgBox(quot;Cancelquot;, vbYesNo) If Answer = vbYes Then Exit Sub End If
Else: MsgBox Err: Exit Sub

End If
Resume

The WaitTime is the max time your code should run. This is another option in stead of using disabling the cancel key - I just think it is a bit risky. This routine will wait 30 seconds and then re-enable the cancel/break button.

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()