I believe that I am doing something wrong in my error handeling. For some reason, the program catches the error on the first time through the loop but not the second time. Any ideas why this would be the case?
For i = 1 To 10
loopTime:
On Error GoTo theError
<code>
theNumber = MsgBox("There is no error", vbCritical, "Check")
Next i
Exit Sub
theError:
theNumber = MsgBox("There was an error", vbCritical, "Check")
i = i + 1 'Is this necessary?
GoTo loopTime
end sub
For i = 1 To 10
loopTime:
On Error GoTo theError
<code>
theNumber = MsgBox("There is no error", vbCritical, "Check")
Next i
Exit Sub
theError:
theNumber = MsgBox("There was an error", vbCritical, "Check")
i = i + 1 'Is this necessary?
GoTo loopTime
end sub