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.

See also


⏮️ VBR00011 Division by zero | ⏭️ VBR00014 Out of string space


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