On Error ??

K

Kevin

Can you have an On Error Goto ErrHandle and then once it is done handling the error resume from where the error occured

Example would be that I am copying several files to different workstations. It can't copy the file to the workstation because it is not running. This would be the error. It would then goto an error ahndle where it write this information to a log. I then want it to continue from the point that error occured

TIA
 
T

Tom Ogilvy

On error goto ErrHandler

' code to cause an error


ErrHandler:
' code to write log

Resume Next
End Sub

--
Regards,
Tom Ogilvy

Kevin said:
Can you have an On Error Goto ErrHandle and then once it is done handling
the error resume from where the error occured.
Example would be that I am copying several files to different
workstations. It can't copy the file to the workstation because it is not
running. This would be the error. It would then goto an error ahndle where
it write this information to a log. I then want it to continue from the
point that error occured.
 
B

Bob Phillips

Check out Resume Next in help.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Kevin said:
Can you have an On Error Goto ErrHandle and then once it is done handling
the error resume from where the error occured.
Example would be that I am copying several files to different
workstations. It can't copy the file to the workstation because it is not
running. This would be the error. It would then goto an error ahndle where
it write this information to a log. I then want it to continue from the
point that error occured.
 
C

Chip Pearson

Kevin,
Can you have an On Error Goto ErrHandle and then once it is done handling
the error resume from where the error occured.


In your error handling block, use the Resume statement to resume code
execution at the line of code that caused the error. Use Resume Next to
resume code execution at the line following the line that raised the error.
Under no circumstances use GoTo in your error handling block.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


Kevin said:
Can you have an On Error Goto ErrHandle and then once it is done handling
the error resume from where the error occured.
Example would be that I am copying several files to different
workstations. It can't copy the file to the workstation because it is not
running. This would be the error. It would then goto an error ahndle where
it write this information to a log. I then want it to continue from the
point that error occured.
 
Top