Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ErrorHandler question

Status
Not open for further replies.

tgmoon

Technical User
Jan 31, 2001
54
GB
I have a whole load of little subs in a modules.... eg

Sub WM1()
On Error Goto ErrorHandler
my code
Exit Sub

ErrorHandler:
MsgBox "Error"
End Sub.

What I was wondering is if it is possible to have a single ErrorHandler that encompases the whole module?
 
You can write an error handling sub then in each sub in the module, have the ErrorHandler code call the sub that you created to handle errors.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top