Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
LAF
 
Posts: n/a
Default 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   Report Post  
Junior Member
 
Posts: 2
Post

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   Report Post  
Junior Member
 
Posts: 2
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable VBA code execution when loading a workbook Charles Excel Discussion (Misc queries) 4 October 14th 05 09:12 PM
Change case...help please Terry Excel Worksheet Functions 14 October 2nd 05 12:29 PM
code execution has been interrupted del Excel Discussion (Misc queries) 0 September 3rd 05 12:22 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM


All times are GMT +1. The time now is 06:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"