14-05-2008, 12:59 AM
DFA Wrote:On Error Resume Next is the only solution for that specific problem
If "On Error Resume Next" burns your eyes, try...
Code:Public Sub Name()
On Error Goto ErrorHandle1
Exit Sub
ErrorHandle1:
End Sub
And a good thing to put in the ErrHandle1 label section is something like:
Code:
If Err.Number > 0 Then
AddLog "Error: " & Err.Number & "; While running Sub Name(" & Variable1 & ", " & Variable2 & ") at " & whatever function for time & ".", "errorlist.txt"
End If
That's still not good error handling...what would be even better is to do error trapping like vbGORE does with On Error GoTo 0 or however it does it...and also to display the sub name with the variables that are in it.