tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,924
- Office Version
- 365
- 2019
- Platform
- Windows
Standard module:
MyClass:
This line brings up a compile and syntax error message:
so I changed it to:
then this line returns a Object variable or With block variable not set:
Can someone tell me what is wrong?
Thanks
Rich (BB code):
Dim MyVar(1 To 10, 1 To 10) As MyClass
Set MyVar(1 To 10, 1 To 10) = New MyClass
MyVar(1, 1).Category = "Some category"
MyVar(2, 1).Fruit = "Some fruit"
MyClass:
Rich (BB code):
Private pCategory As Variant
Private pFruit As Variant
Public Property Get Category() As Variant
Category = pCategory
End Property
Public Property Let Category(ByVal Cat As Variant)
pCategory = Cat
End Property
Public Property Get Fruit() As Variant
Fruit = pFruit
End Property
Public Property Let Fruit(ByVal F As Variant)
pFruit = F
End Property
This line brings up a compile and syntax error message:
Rich (BB code):
Set MyVar(1 To 10, 1 To 10) = New MyClass
so I changed it to:
Rich (BB code):
Set MyVar(10, 10) = New MyClass
Rich (BB code):
MyVar(1, 1).Category = "Some category"
Can someone tell me what is wrong?
Thanks
Last edited: