Microsoft Office Tutorials and References
In Depth Information
Example 7-2. Error Handling with the Resume Statement
Example 7-2. Error Handling with the Resume Statement
Sub test()
Dim sNew As String
sNew = "a:\test.xls"
On Error GoTo ERR_DISK
Workbooks.Open sNew
Exit Sub
ERR_DISK:
If Err.Number = 1004 Then
sNew = InputBox("Cannot find file. Enter new location or
leave blank to
If sNew <> "" Then
Resume
Else
Exit Sub
End If
End If
End Sub
The third variation:
Resume ALabel
causes VBA to resume execution at the line labeled ALabel .
 
Search JabSto ::




Custom Search