Table of Contents

RDC00211: On Error GoTo -1

Severity: Hint  ·  Family: RDC (Rubberduck Core analyzers)  ·  Raised by: OnErrorGoToMinusOneAnalyzer

A procedure holds an On Error GoTo -1 statement.

On Error GoTo -1 ends the error being handled, and keeps the error-handling policy as it is. MS-VBAL does not document it; MS-VBA compiles it, and so does RD-VBA (RD-VBAL §5.4.4.1 On Error Statement). A reader can rarely tell what it does.

A Resume also ends the handler, and says where the procedure goes on. On Error GoTo 0 turns error handling off.

The finding is the statement.

How it is raised

Situation Example Resolution
An On Error GoTo -1 statement. Handler:
On Error GoTo -1
End the handler with Resume, Resume Next or Resume <label>.

See also


ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca