Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using OnError
#3
Code:
Sub HandleData(Index As Long, Data As String)
On Error GoTo Hell

      codecodecodecode

Exit Sub 'stupid mis
Hell:
     log code
End Sub

visual representation of what funky said.

Or soemthing like this:
Code:
Sub HandleData(Index As Long, Data As String)
On Error Resume Next

     code code code code

     If Err.Number  0 Then 'can also amke thsi so it does specific things for each error.
          log code
          Err.Clear
     End If
End Sub

that will continue through the code and post the error at the end, incase things still need to be ran further on.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)