Link to home
Start Free TrialLog in
Avatar of mutrus
mutrus

asked on

What is On Error GoTo -1

I came across this code in a macro

On Error GoTo -1: On Error GoTo EndDoc_

I am familiar with what the On Error does but can someone tell me what the GoTo -1 statement does

Thanks
Avatar of manf788265
manf788265
Flag of South Africa image

hi mutrus
normally this would mean that somewhere in the procedure is a label called "-1:" (and that the code written below this label would be executed)
Regards, Manfred
Avatar of forsbom
forsbom

Hi mutrus
It's not often I see the On Error GoTo -1 .......

On Error Goto 0 clears the error handler.
On Error Goto ?1 clears the current exception. It works pretty much like the Err.Clear statment.


I hope this is of any help ....

Peter
ASKER CERTIFIED SOLUTION
Avatar of forsbom
forsbom

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mutrus

ASKER

Thanks Peter

I thought as much but needed to be sure