XL: Type Mismatch: Array or User Defined Type ExpectedLast reviewed: February 3, 1998Article ID: Q121114 |
The information in this article applies to:
SUMMARYIn Microsoft Excel, when a Microsoft Visual Basic for Applications procedure passes the value of one array to another array, if the data types of the two arrays are not compatible, you may receive one of the following error messages:
Type mismatch: Array or User Defined Type Expected. -or- Compile error: Type mismatch: array or user-defined type expectedThese error messages are not clear. A more accurate error message is the following:
Type mismatch: arrays not of compatible types RESOLUTIONTo make sure that the data types for both arrays are compatible, dimension both arrays with the same data type.
MORE INFORMATION
Steps to Reproduce Behavior
Sub Correct() Dim A(1 to 20) As Double Example A() End Sub Sub Example(B() As Double) End SubNote that the data type of both arrays is double.
|
Additional query words: 5.00 5.00a 5.00c 7.00 97 XL97
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |