5.5.1.2.9 Let-coercion to and from Error

The semantics of Error Let-coercion depend on the source’s value type and the destination’s declared type:

Source Value Type

Destination

Declared Type

Semantics

Error

Any type except a fixed-size array or Variant

Runtime error 13 (Type mismatch) is raised.

Any numeric type, Boolean, Date, String, array or UDT

Error

The source value is converted to a Long using the Let-coercion rules for Long. If this Long representation is between 0 and 65535, inclusive, the result is an Error data value representing the standard error code specified by the Long value.

 

Otherwise, runtime error 5 (Invalid procedure call or argument) is raised.