Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey guys,
When I am running a particular code (loop code) and I stop it, I get a debug error. I would prefer to get a messagebox saying "Program Stopped!" How would I do this? I was thinking maybe with a label? Thanx Todd Huttenstine |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I came across this article which should work:
http://groups.google.co.nz/groups?hl...6F6%40kpmg.com Sub noesc() 'set it up so if user hits esc, you send it to error handler Application.EnableCancelKey = xlErrorHandler On Error GoTo 1 While True ActiveCell.Offset(1).Select 'press esc here Wend Exit Sub 1: MsgBox "You pressed esc" End Sub "Todd Huttenstine" wrote in message ... Hey guys, When I am running a particular code (loop code) and I stop it, I get a debug error. I would prefer to get a messagebox saying "Program Stopped!" How would I do this? I was thinking maybe with a label? Thanx Todd Huttenstine |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well the user really wont hit Esc, they will just hit
cancel on an Outlook Email Dialog screen. I want it to be something like this logic.... On Error GoTo Problem: Problem: MsgBox "Program Stopped!" Exit Sub Is this possible? RIght now if I put that in my code it will run through that code and exit sub. Thanx -----Original Message----- Hey guys, When I am running a particular code (loop code) and I stop it, I get a debug error. I would prefer to get a messagebox saying "Program Stopped!" How would I do this? I was thinking maybe with a label? Thanx Todd Huttenstine . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Looks good to me
"Todd Huttenstine" wrote in message ... Well the user really wont hit Esc, they will just hit cancel on an Outlook Email Dialog screen. I want it to be something like this logic.... On Error GoTo Problem: Problem: MsgBox "Program Stopped!" Exit Sub Is this possible? RIght now if I put that in my code it will run through that code and exit sub. Thanx -----Original Message----- Hey guys, When I am running a particular code (loop code) and I stop it, I get a debug error. I would prefer to get a messagebox saying "Program Stopped!" How would I do this? I was thinking maybe with a label? Thanx Todd Huttenstine . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Debug Error | Excel Discussion (Misc queries) | |||
Debug Error | Excel Discussion (Misc queries) | |||
Debug error 1004 | Excel Discussion (Misc queries) | |||
Debug Error | Excel Discussion (Misc queries) | |||
Macro Debug Error | Excel Discussion (Misc queries) |