On Error {...} Resume Next

G

Guest

Hello:

I want to use the On Error Resume Next statement to allow my code to
continue running but before the "Resume Next" part of the statement executes,
I would like some intermediate code to run first. So, upon an error, I would
like the main program to catch it, run some code, then resume program
execution with the statement following the error. How can I insert the
intermediate code?

Thanks,
 
G

Guest

You are looking for on error goto

sub whatever()
on error goto Errorhandler
'do some stuff

exit sub
ErrorHandler:
'do the error stuff
resume next
End sub
 
G

Guest

This is great!! Thank you Jim...



Jim Thomlinson said:
You are looking for on error goto

sub whatever()
on error goto Errorhandler
'do some stuff

exit sub
ErrorHandler:
'do the error stuff
resume next
End sub
 

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

Similar Threads


Top