Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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