Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default code execution has been interupted - Excel 2003

After using ctr alt Break to stop a macro mid flow it continues to pop up and
break code running. Even after I have closed the workbook and try to run the
code in normall fashion this error message constantly re appears. Only after
pressing continue ~ 50 do we return to normall.

Can only assume this is a known bug with the application - but any thoughts
on resolutions / fixes.

Regards, David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default code execution has been interupted - Excel 2003

David,
Depending on how your code is written/structured, pressing Escape
or Ctrl + Break will only interrupt your code not stop it.
There is a "reset" button on the Standard and Debug menu bars in the
VBE which will do just that. (looks like a dark square)
Also, take a look in help for the "EnableCancelKey" property.
Make sure to read all of the remarks.
Finally, be aware that overall error handling settings are found in...
Tools | Options | General (tab) in the VBE.
--
Jim Cone
Portland, Oregon USA



"David_W"

wrote in message
After using ctr alt Break to stop a macro mid flow it continues to pop up and
break code running.
Even after I have closed the workbook and try to run the
code in normall fashion this error message constantly re appears.
Only after pressing continue ~ 50 do we return to normall.

Can only assume this is a known bug with the application - but any thoughts
on resolutions / fixes.
Regards, David
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default code execution has been interupted - Excel 2003

You should use the EnableCancelKey property to specify what is to be
done if the user breaks out of the code.


Application.EnableCancelKey = xlDisabled
' Dangerous. You can't break out
' of a rogue loop without using CTRL ALT DELETE

Application.EnableCancelKey = xlInterrupt
' Sloppy. opens the VBE on the break line.
' Users will be confused.

Application.EnableCancelKey = xlErrorHandler
' Best solution:

On Error GoTo ErrH:
'''''
' your code here
'''''

ErrH:
If Err.Number = 18 Then
MsgBox "Break Key Pressed"
If Err.Number < 0 Then
MsgBox "Some other error" & vbCrLf & Err.Description
Else
' no error. do nothing.
End If

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Mon, 19 Jan 2009 01:17:02 -0800, David_W
wrote:

After using ctr alt Break to stop a macro mid flow it continues to pop up and
break code running. Even after I have closed the workbook and try to run the
code in normall fashion this error message constantly re appears. Only after
pressing continue ~ 50 do we return to normall.

Can only assume this is a known bug with the application - but any thoughts
on resolutions / fixes.

Regards, David

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
Code Execution Has Been Interupted michael.beckinsale Excel Programming 0 November 10th 07 10:38 AM
Code has been interupted - error message Jeff Excel Discussion (Misc queries) 0 May 10th 07 03:23 PM
Macro 'Code execution has been interupted' error after print? Bluehair the Pirate Excel Programming 1 February 9th 06 06:19 PM
Code Execution has been interupted Rich Excel Discussion (Misc queries) 2 May 10th 05 12:52 PM
"Code execution has been interupted" Dennis Fry Excel Programming 2 September 17th 03 08:29 PM


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

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

About Us

"It's about Microsoft Excel"