T
Todd Huttenstine
Hey guys, below is an error handler I have. It will goto
label ErrHandler2a when there is an error. The error I am
trying to trap is error 52, so below that label I specify
what to do when it encounters error type 52. The reason
there would be an error (error type 52) is if one of the
variables are an invalid file path. This code works the
first time it encounters the error, however the 2nd time
it encounters, it displays the debug message telling me
error type 52. This is the exact thing it handled the
first time, whats wrong with it the 2nd time? I always
thought that when the "next" statement executes, the error
is reset. Is this right?
On Error goto ErrHandler2a
ABFileFrom2 = BS & "\" & f1x.Name
ABFileTo2 = ABL2 & "\" & f1x.Name
FileCopy ABFileFrom2, ABFileTo2
DoEvents
ErrHandler2a:
If Err.Number = 52 Then
Else
End If
Else
Resume Next
End If
Next
End If
label ErrHandler2a when there is an error. The error I am
trying to trap is error 52, so below that label I specify
what to do when it encounters error type 52. The reason
there would be an error (error type 52) is if one of the
variables are an invalid file path. This code works the
first time it encounters the error, however the 2nd time
it encounters, it displays the debug message telling me
error type 52. This is the exact thing it handled the
first time, whats wrong with it the 2nd time? I always
thought that when the "next" statement executes, the error
is reset. Is this right?
On Error goto ErrHandler2a
ABFileFrom2 = BS & "\" & f1x.Name
ABFileTo2 = ABL2 & "\" & f1x.Name
FileCopy ABFileFrom2, ABFileTo2
DoEvents
ErrHandler2a:
If Err.Number = 52 Then
Else
End If
Else
Resume Next
End If
Next
End If