Hello everybody,
I am experimenting with class modules, and getting stuck. I want one of the read/write properties to be a range. I tried doing so as follows, in the class module:
<pre>-----
Private xDataRange As Range
-----
Public Property Get DataRange() As Range
DataRange = xDataRange
End Property
-----
Public Property Let CDRange(ByVal UserRange As Range)
xDataRange = UserRange
End Property
-----
Private Sub Class_Initialize()
xDataRange = Range("A1:B2")
End Sub
-----
</pre>
In a normal module, the following code gives a "Object variable or With block variable not set" error (error 91):
<pre>-----
Dim TestInstance As New TestObject
MsgBox TestInstance.DataRange.Address
-----
</pre>
Any advice? Thanks!



