Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Centralised error handler

Hello,

Maybe this looks kind a weird, because there are a lot of topics about
this isue.
Anyway I hope somone can give me a clear explanation if it is possible
(and how), or it isn't.
In most of the topics i saw questions about error handlers within error
handlers.
Or the topics are from 1997, so i think there is a lot different right
now.

I have round 8 procedures who will run with one button.
This is my errorhandler code:
Public Sub Errorhandler()
On Error GoTo handleCancel
Application.EnableCancelKey = xlErrorHandler

For X = 1 To 1000000 ' Do something 1,000,000 times (long!)
' do something here
Next X

handleCancel:
If Err = 18 Then
If MsgBox("Do you want to quit?", vbYesNo) = vbYes Then
GoTo Ending
Else
Resume
End If
End If
Ending:

Under Ending there normally is a code who protect my sheets again.
My question is can i make a procedure with this errorhanler, so this
handler will be active all the time when the macro is running??

I couldn't found somthing like that in other posts, or it was so
complex i don't get it anymore.

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
Error handler linto Excel Discussion (Misc queries) 1 February 11th 10 12:17 PM
Error Handler sharad Excel Discussion (Misc queries) 1 September 17th 07 06:38 PM
Error Handler Not Working Bill Excel Discussion (Misc queries) 0 August 25th 05 07:13 PM
Error Handler dht[_2_] Excel Programming 5 August 19th 04 08:51 AM
error handler Fleur Excel Programming 1 November 20th 03 06:06 AM


All times are GMT +1. The time now is 02:25 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"