Visual Basic for Applications Reference
Type mismatch (Error 13)
See Also Specifics
Visual Basic is able to convert and coerce many values to accomplish data type assignments that weren't possible in earlier versions. However, this error can still occur and has the following causes and solutions:
Try to make assignments only between compatible data types. For example, an Integer can always be assigned to a Long, a Single can always be assigned to a Double, and any type (except a user-defined type) can be assigned to a Variant.
An object was passed to a procedure that is expecting a single property or value.
Pass the appropriate single property or call a method appropriate to the object.
Specify an expression that can be displayed.
You attempted to mix traditional Basic error handling with Variant values having the Error subtype (10, vbError), for example:
To regenerate an error, you must map it to an intrinsic Visual Basic or a user-defined error, and then generate that error.
A CVErr value can't be converted to Date. For example:
MyVar = CDate(CVErr(9))
Use a Select Case statement or some similar construct to map the return of CVErr to such a value.
To print arrays, create a loop that displays each element individually.
For additional information, select the item in question and press F1.