Hi,
I am looking for an IF statement, If I get error - run time error 68 - Device unavailable then
do this
else
do that
could anyone help with the syntax?
thanking you in advance, tapapad
Hi,
I am looking for an IF statement, If I get error - run time error 68 - Device unavailable then
do this
else
do that
could anyone help with the syntax?
thanking you in advance, tapapad
Your code goes between the On Error GoTo and Exit Sub statements.
If no error occurs, code runs to Exit Sub.
![]()
Sub YourSub() Dim ThisandThat On Error GoTo ErrorHandler 'your code goes here, between the On Error GoTo and Exit Sub statements 'if no error occurs, code runs to Exit Sub Exit Sub ErrorHandler: If Err.Number = 68 Then MsgBox "Error number: " & Err.Number & vbCrLf & Err.Description, vbCritical, "Something is wrong!" Else MsgBox "A different error occurred" End If End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks