I am trying to build a tree class. Here is the relevant code from the class CNode:
Private pChildA As CNode
Private pParentA As CNode
Public Property Get childA() As CNode
child = pChildA
End Property
Public Property Set childA(inChild As CNode)
Set pChildA = inChild
End Property
Public Property Get parentA() As CNode
parentA = pParentA
End Property
Public Property Set parentA(inParentA As CNode)
Set pParentA = inParentA
End Property
Public Sub testing(x As CNode)
Set Me.parentA = x
Dim tempNode
Set tempNode = Me.parentA
Set tempNode.childA = Me
End Sub
***********************************************
In a module, I have the following subroutine:
Sub test()
Dim nodeA As CNode, nodeC As CNode
Set nodeA = New CNode
Set nodeC = New CNode
Call nodeA.testing(nodeC)
End Sub
**************************
When I run this I get Run-time error '91': Object variable or With block variable not set.
Can anyone help me?
Private pChildA As CNode
Private pParentA As CNode
Public Property Get childA() As CNode
child = pChildA
End Property
Public Property Set childA(inChild As CNode)
Set pChildA = inChild
End Property
Public Property Get parentA() As CNode
parentA = pParentA
End Property
Public Property Set parentA(inParentA As CNode)
Set pParentA = inParentA
End Property
Public Sub testing(x As CNode)
Set Me.parentA = x
Dim tempNode
Set tempNode = Me.parentA
Set tempNode.childA = Me
End Sub
***********************************************
In a module, I have the following subroutine:
Sub test()
Dim nodeA As CNode, nodeC As CNode
Set nodeA = New CNode
Set nodeC = New CNode
Call nodeA.testing(nodeC)
End Sub
**************************
When I run this I get Run-time error '91': Object variable or With block variable not set.
Can anyone help me?