VBGamer |
|
RE: File finding Corre (0 replies, 0 views) (2000-Aug-28) On Error Goto can not jump to a Sub, it has to jump to a label within the same sub, like this:
Sub Whatever()
On Error Goto ERROR_check
'some file operation that might generate the error
Exit Sub
ERROR_check:
Unload Me
End Sub
You could also use On Error Resume Next, like this:
Sub Whatever()
On Error Resume Next
'some file operation that might generate the error
If Err.Number=53 Then
Unload Me
End If
End Sub |