Hi,
A colleague (who is even more lazy than me) wants to write a generic Error handler for his db/excel code.
Only he is so lazy he doesn't want to hard code if possible.
Example Code:
I haven't come across it, and I personally would hardcode it. But it was just a thought if there was a way to retrieve the sub name etc whilst running.Code:Public sub Blah() On error goto ErrH: '---- other code ErrH: ErrorHandlerSub <thissub> End Sub Public Sub ErrorHandlerSub(byval strSubThatErrored as string) debug.print "Error : " & err.number & " - " & err.description debug.print "Errored in : " & strSubThatErrored End Sub




Reply With Quote