programming practice. Where errorhandlers are concerned this practice
sometimes gets bent a little and I'd like to share a very, very simple solution
to ensure a nice flow and exit from a routine.....no exit sub or exit function
statements to be seen.
Function Test()
' Dim your local vars etc
On Error Goto ErrorHandler:
' Do the stuff in the function.
ErrorHandler:
' Check to see if an error has been raised.
If Err <> 0 Then
' Do the Error Handler stuff here.
End If
' Turn off the Error Handler.
On Error Goto 0
' Gracefully drop out of the routine.
End Function
This was first published in November 2000