A user-defined type must be defined before it can be referenced. This error has the following causes and solutions:
OtherVar
is declared before its type (OtherType
) is known:
Type MyType
OtherVar As OtherType
End Type
Type OtherType
WholeVar As Integer
RealVar As Double
End Type
Reposition the type definitions so that the forward reference doesn't occur.
Type MyType
MyVar As Integer
OtherVar As MyType
End Type
Remove the self-referencing nested type. This may occur indirectly if you nest a type within another type in which the first is already declared. Check the definition of each nested type to eliminate duplication.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).