Hi guys;
I have On Error GoTo routine in a module.
in the error-handling routine, I have On Error GoTo 0
The first time the error is hit; process goes to "routine", correctly.
The second time, however, process does not jump. Err.number is set.
Why?
Also, is there a way to test for an object containing Nothing ( not
valid reference)?
Thanks;
Jerry
Jim Thomlinson - 20 Jan 2006 17:08 GMT
An error handler can not have an error handler in it. As for testing an
object that is do-able...
Dim wks as worksheet
if wks is nothing then msgbox "No sheet"
set wks = sheet1
if wks is nothing then msgbox "Still no sheet"

Signature
HTH...
Jim Thomlinson
> Hi guys;
>
[quoted text clipped - 11 lines]
> Thanks;
> Jerry
Chip Pearson - 20 Jan 2006 18:14 GMT
When an error occurs and you have an On Error Goto statement, VBA
is operating in Error mode, and no other errors can be trapped
until you exit Error mode. You exit error mode by exiting the
procedure or by using a Resume or Resume Next statement in the
error handling code. An error handling block of code cannot have
an On Error statement in it.

Signature
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
> Hi guys;
>
[quoted text clipped - 14 lines]
> Thanks;
> Jerry
Jerry - 20 Jan 2006 18:31 GMT
Thank Jim "Is Nothing" is not nothing. That worked and the error
handler was removed.