On Error doesn't catch second error in code 
Author Message
 On Error doesn't catch second error in code

I have set up a On Error GoTo statement and the error
handling code (at end of code). The On Error GoTo
statement is between the Dim statements and normal code.
It works fine if the error occurs only once during the
running of the macro. However, the second time the error
occurs, the macro fails and the error is not handled by
the error handling code. Does the On Error GoTo statement
have to be within the code loop to reset? Is there a reset
command? Thanks


Mon, 18 Oct 2004 21:30:02 GMT  
 On Error doesn't catch second error in code
I think you need to do an Err.Clear after you've handled the error, then the
normal On Error code should kick in again.


Quote:
> I have set up a On Error GoTo statement and the error
> handling code (at end of code). The On Error GoTo
> statement is between the Dim statements and normal code.
> It works fine if the error occurs only once during the
> running of the macro. However, the second time the error
> occurs, the macro fails and the error is not handled by
> the error handling code. Does the On Error GoTo statement
> have to be within the code loop to reset? Is there a reset
> command? Thanks



Mon, 18 Oct 2004 22:58:06 GMT  
 On Error doesn't catch second error in code
Thanks

Quote:
>-----Original Message-----
>Have you tried Err.Clear in your error handling routine.

>Mark Baird
>>-----Original Message-----
>>I have set up a On Error GoTo statement and the error
>>handling code (at end of code). The On Error GoTo
>>statement is between the Dim statements and normal code.
>>It works fine if the error occurs only once during the
>>running of the macro. However, the second time the error
>>occurs, the macro fails and the error is not handled by
>>the error handling code. Does the On Error GoTo
statement
>>have to be within the code loop to reset? Is there a
>reset
>>command? Thanks
>>.

>.



Tue, 19 Oct 2004 04:59:01 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. CTD 2.1 ActiveX Container doesn't catch the second UserControl_KeyDown vb6 Event

2. CTD 2.1 ActiveX Container doesn't catch the second UserControl_KeyDown vb6 Event

3. try/catch a runtime error doesn't work

4. User-defined error when the user doesn't define any errors

5. ERROR - on error - doesn't work - why

6. No error VB3 but error VB4 (object doesn't support property)

7. On Error doesn't trap error!

8. ERROR - on error - doesn't work - why

9. ERROR Code 0x80004005 : ERROR Code 0xfee670 : ERROR 1157

10. Error caught in debug, not caught when installed

11. Run-time error '-2147417846 (8001010a)': Automation error (error 440)

12. Run-time error '-2147417846 (8001010a)': Automation error (error 440)

 

 
Powered by phpBB® Forum Software