Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Is there a "generic" Error Handling method

Is there an Error Handling method that can be used in a generic sense? i.e.
a statement that can be included in any sub. that will handle any error to
some degree.

Thanks,
Brad K
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default Is there a "generic" Error Handling method

Of course everyone has there own but you could use something like:

On Error GoTo ErrorHandler

'Your code

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''
'' Close and tidy up
Tidy:

'' Reset variables
Set cnn = Nothing
Set cmd = Nothing
ActiveSheet.Protect
Application.EnableEvents= True
' etc --- comment out the ones that don't apply
Exit Sub

'' - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ErrorHandler:

MSG ="Error Number: " & Err & _
Chr(10) & "Error Description: " & Error()

MsgBox NSG, vbInformation, "ERROR:"
GoTo Tidy

End Sub

"Brad K." wrote:

Is there an Error Handling method that can be used in a generic sense? i.e.
a statement that can be included in any sub. that will handle any error to
some degree.

Thanks,
Brad K

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
"Select method of Range class failed" Error Ayo Excel Discussion (Misc queries) 3 September 2nd 08 07:58 PM
"GoalSeek method of Range object failed" error message Fixit_Steve Excel Programming 0 January 13th 05 07:29 PM
VBA error 1004 "Select method of Range class failed" Matt J Excel Programming 6 July 3rd 04 10:05 PM
Error 1004, "select method of range class failed" paritoshmehta[_11_] Excel Programming 3 May 6th 04 10:09 PM
Getting "compile error" "method or data member not found" on reinstall Bp Excel Programming 1 April 23rd 04 04:42 PM


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

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"