Every time I run my test method I get the following error "Run-time error '91' Object variable or With block variable not set"
What am I doing wrong
This is the test class to test my person class
Public Sub testClass()
Dim p As Person
Set p = New Person
Dim d As Details
Set d = New Details
Set p.Details = d
p.Details.Age = 20
p.Details.Name = "chris"
End Sub
This is the Person Class
Private pDetails As Details
Public Property Get Details() As Details
Details = pDetails
End Property
Public Property Set Details(value As Details)
pDetails = value
End Property
This is the Details class
Private pName As String
Private pAge As Integer
Public Property Get Name() As String
Name = pName
End Property
Public Property Get Age() As Integer
Name = pName
End Property
Public Property Let Name(ByVal value As String)
pName = value
End Property
Public Property Let Age(ByVal value As Integer)
pAge = value
End Property
Public Function toString() As String
toString = pName & "," & pAge
End Function
Thanks in advance
Chris