Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Code execution has been interrupted
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 "Code execution has been interrupted" 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: http://www.excelforum.com/member.php...fo&userid=9656 View this thread: http://www.excelforum.com/showthread...hreadid=498175 |
#2
|
|||
|
|||
This 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 |
#3
|
|||
|
|||
Another solution is this:
WaitTime=30 Tyd = Timer On Error GoTo HandleCancel 'trap errors of Cancel bug Application.EnableCancelKey = xlErrorHandler -------------Your main code Exit Sub HandleCancel: If Err = 18 Then If Timer - Tyd WaitTime Then Answer = MsgBox("Cancel", 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Disable VBA code execution when loading a workbook | Excel Discussion (Misc queries) | |||
Change case...help please | Excel Worksheet Functions | |||
code execution has been interrupted | Excel Discussion (Misc queries) | |||
Macro for changing text to Proper Case | Excel Worksheet Functions | |||
Make Change Case in Excel a format rather than formula | Excel Worksheet Functions |