• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 323
  • Last Modified:

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
0
mutrus
Asked:
mutrus
  • 2
1 Solution
 
manf788265Commented:
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
0
 
forsbomCommented:
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
0
 
forsbomCommented:
Hi again mutrus
Oooops,it should be :
On Error Goto -1 clears the current exception. It works pretty much like the Err.Clear statment.

Peter
0
 
mutrusAuthor Commented:
Thanks Peter

I thought as much but needed to be sure
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now