Table of Contents

VBR00013: Type mismatch

Severity: Error  ·  Family: VBR (runtime semantics)  ·  Source metadata: VBRuntimeErrorInfo

A value cannot be coerced to the type that is required.

MS-VBA run-time error 13; the numeric portion of the code is the error's number. This code is raised by ArrayBoundRuntimeSemantics, ArrayStatementRuntimeSemantics, BinaryArithmeticOperatorRuntimeSemantics, BinaryConcatOperatorRuntimeSemantics, BinaryLetAssignmentOperatorRuntimeSemantics, BinaryLogicalOperatorRuntimeSemantics, BinaryOperatorRuntimeSemantics, BinaryRelationalOperatorRuntimeSemantics, FixedAssignmentRuntimeSemantics, ILetCoercionRuntimeSemanticsProvider, LetCoercionRuntimeSemantics, OperatorRuntimeSemantics, ProcedureExecutor, SetCoercionRuntimeSemantics, StdConversion, StdFinancial, UnaryLetCoerceOperatorRuntimeSemantics, UnaryOperatorRuntimeSemantics, ValueConversionResult, ValueConversions, StdCollection.

How it is raised

Situation Example Resolution
A value cannot be coerced to the type that is required. "abc" + 1, CLng("x"), For Each over a scalar Convert with a function that accepts the value, or fix the type.
A value that is not an object is given to a parameter declared as a class or Object, through a call bound late. o.TakeObj v where o is declared Object and v holds 5 Pass an object, or Nothing.

See also


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