Solved

What is On Error GoTo -1

Posted on 2001-08-23
4
316 Views
Last Modified: 2006-11-17
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
Comment
Question by:mutrus
  • 2
4 Comments
 
LVL 1

Expert Comment

by:manf788265
ID: 6416950
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
 
LVL 3

Expert Comment

by:forsbom
ID: 6417000
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
 
LVL 3

Accepted Solution

by:
forsbom earned 50 total points
ID: 6417004
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
 

Author Comment

by:mutrus
ID: 6417055
Thanks Peter

I thought as much but needed to be sure
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to line 23 53
Need excel formula for todays date subtracting previous day 11 48
Excel formula need currency format 1 23
Excel Macro 9 15
Introduction Perhaps more familiar to developers who primarily use VBScript than to developers who tend to work only with Microsoft Office and Visual Basic for Applications (VBA), the Dictionary is a powerful and versatile class, and is useful …
Introduction It seems that at least a couple of times per month, I answer a question that requires automating Outlook from another Microsoft Office application, usually (although not always) to send one or more email messages.  For example: …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question