Error handling

T

Tim C

What I would like to do:

If Not IsError(ChDir [B5]) Then
ChDir [B5]
more code
End If

But of course IsError isn't for this kind of error. How should I do it?

Thanks,
Tim C
 
B

Bob Kilmer

On Error Resume Next
ChDir [B5]
If Err.Number = 0 Then
'more code
Debug.Print "ok"
Else
'deal w/error
Debug.Print Err.Number
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top