#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default Debug Error

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Debug Error

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default Debug Error

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Debug Error

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
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
Debug Error Ed Davis Excel Discussion (Misc queries) 7 June 16th 09 03:10 PM
Debug Error Ed Davis Excel Discussion (Misc queries) 0 June 16th 09 09:59 AM
Debug error 1004 Kasper Excel Discussion (Misc queries) 7 January 27th 09 02:21 PM
Debug Error Saxman Excel Discussion (Misc queries) 3 August 11th 08 12:42 PM
Macro Debug Error Soroya1920 Excel Discussion (Misc queries) 1 June 26th 07 09:53 PM


All times are GMT +1. The time now is 03:23 PM.

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"