Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default On Error {...} Resume Next

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,

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default On Error {...} Resume Next

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

--
HTH...

Jim Thomlinson


"Edd" wrote:

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,

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default On Error {...} Resume Next

This is great!! Thank you Jim...



"Jim Thomlinson" wrote:

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

--
HTH...

Jim Thomlinson


"Edd" wrote:

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,

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
on error resume next filo666 Excel Programming 7 January 26th 06 06:42 PM
On Error Resume Next ? Nigel Excel Programming 4 August 11th 05 09:07 AM
On Error Resume Next Jim Sharrock Excel Programming 2 May 13th 04 03:12 PM
On Error Resume Next D.S.[_3_] Excel Programming 1 November 28th 03 04:52 PM
On Error Resume Next Mike[_58_] Excel Programming 3 November 23rd 03 05:09 PM


All times are GMT +1. The time now is 01:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"