View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default On Error Resume Next

Thanks Rob, it's clear. But the exception you mentioned is not really an
exception, because the code did not exit the procedure with the "On Error
Resume Next" in operation, so the original rule prevails: "On Error Resume
Next" remains in effect until exiting the procedure it was used in, OR the
code execution reaches another "On Error" statement that explicitly override
the original "On Error Resume Next".
Am I right?

Regards,
Stefi

€˛Rob Bovey€¯ ezt Ć*rta:

"Stefi" wrote in message
...
If I use "On Error Resume Next" in a public function, does "On Error
Resume
Next" remain in effect after stepping out from the function, or have I to
explicitely make it ineffective with an "On Error Goto 0" statement before
steeping out from the function?


Hi Stefi,

The effect of On Error Resume Next is generally confined to the
procedure where it is used. Once code exits that procedure it has the same
effect as the On Error Goto 0 statement. The one major exception to this
rule is when you call another procedure that has no error handling of its
own after an On Error Resume Next statement. In this case, an error in the
called procedure (the one with no error handling) will cause code execution
to silently bail out of that procedure and continue on the next line in the
calling procedure (the one where On Error Resume Next is in operation).

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm