Some of you might have misunderstood me. I said I try to avoid it when possible.
Using this code:
Is a lot more cleaner than using this code:Code:List1.ListIndex = List1.ListIndex + 1 If List1.Selected(List1.ListCount - 1) = True Then Timer1.Enabled = False
But in a case such as the following, it's easiest just to use Error Handling.Code:On Error Resume Next List1.ListIndex = List1.ListIndex + 1
Code:On Error GoTo ErrHandler Open "MyTextFile.txt" For Input As #1 Text1.Text = Input(LOF(1), 1) Close #1 ErrHandler: If Err.Number = 53 Then Call MsgBox("File not found")




Reply With Quote