Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
"Select method of Range class failed" Error | Excel Discussion (Misc queries) | |||
"GoalSeek method of Range object failed" error message | Excel Programming | |||
VBA error 1004 "Select method of Range class failed" | Excel Programming | |||
Error 1004, "select method of range class failed" | Excel Programming | |||
Getting "compile error" "method or data member not found" on reinstall | Excel Programming |