Illegal use of property: <property name>
You tried to use the named property as one of the following:
- The target in a Get or Put statement
- The target in an Input # or Line Input # statement
- The target in an LSet, RSet, or Mid statement
You must use a variable, not a property, for any of these purposes.
This error also occurs when the property appears with a subscript as the target of an assignment statement. For example:
Dim privateArray(1 To 2) As String
Property Set MyProperty As Variant
privateArray(1) = MyProperty(1)
privateArray(2) = MyProperty(2)
End Property
Property Get MyProperty As Variant
MyProperty = privateArray
End property
MyProperty(1) = "Fred" ' Produces error
To assign values to MyProperty, assign it a whole array:
Dim anArray(1 To 2) As String
anArray$(1) = "Fred"
MyProperty = anArray