Can someone please tell me what is wrong with the following?
This is in module1:
This is in Class1:
When I run this, it says, "Object variable or With block variable not set"
Thanks
This is in module1:
Code:
Option Explicit
Sub test()
Dim abc As Class1
Set abc = New Class1
abc.Mysheet = "Sheet1"
End Sub
This is in Class1:
Code:
Option Explicit
Private pMySheet As Worksheet
Public Property Get Mysheet() As Variant
Mysheet = pMySheet
End Property
Public Property Set Mysheet(ByVal vNewValue As Variant)
pMySheet = vNewValue
End Property
When I run this, it says, "Object variable or With block variable not set"
Thanks