Error Statement

Syntax

Error errornumber

errornumber

Use: Optional

Data Type: Long

Any valid error code.

Description

Raises an error.

Rules at a Glance

The Error statement is included only for backward compatibility; instead, you should use the Err.Raise method in new code.

See Also

Err.Raise Method

Get VB & VBA in a Nutshell: The Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.