I have a Class InsertInfo with the Properrty
Private myPPTRange As Range
Public Property Get PPTRange() As Range
PPTRange = myPPTRange
End Property
Public Property Set PPTRange(ByVal value As Range)
myPPTRange = value
End Property
Now I want to assign a range to it with
Sub test()
Dim objInfo as New InsertInfo
Set objInfo.PPTRange = ThisWorkbook.Worksheets("Tab").Cells(1,2)
End Sub
Usually assigning a cell to a range works fine in the code but in the situation above I always get the error:
"Objectvariable or with-blockvariable not set"
So to me it looks like it has something to do with the class property but I just cannot see what the problem is. Anyone who can help me with it?
EDIT:
Dim rngTemp as Range
Set rngTemp = ThisWorkbook.Worksheets("Tab").Cells(1,2)
works fine btw. So it really looks like I have to adjust my class property. I already tried a ByRef instead of a ByVal but I still get the Error Message.