I have the standard error routine as follows:
Is there a way to write the error routine at the module level, so that any error occurring in any procedure is handled via this routine. This would save the need to rewrite much the same code in every sub procedure. I realise I would have to somehow pass the name of the failing procedure to the Error Handler. From previous posts, the name of the procedure is not exposed.
Thanks
Code:
Sub Do_Stuff()
On Error GoTo Err_Handler
'sub procedure does stuff
Endit:
Application.Interactive = True
Exit Sub
Err_Handler:
MsgBox _
"An unexpected error has been detected" & Chr(13) & _
"Description is: " & Err.Number & " , " & Err.Description & Chr(13) & _
"Module is: Do_Stuff" & Chr(13) & _
"Please contact ShaunK with the above details"
Resume Endit
Is there a way to write the error routine at the module level, so that any error occurring in any procedure is handled via this routine. This would save the need to rewrite much the same code in every sub procedure. I realise I would have to somehow pass the name of the failing procedure to the Error Handler. From previous posts, the name of the procedure is not exposed.
Thanks