Children Property

Microsoft Excel Visual Basic

Children Property

       

 Returns a DiagramNodeChildren object, representing the collection of child nodes of a particular node.

expression.Children

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

The following example creates a diagram and adds child nodes to it.

Sub CreatePyramidDiagram()

    Dim dgnNode As DiagramNode
    Dim shpDiagram As Shape
    Dim intCount As Integer

    'Add pyramid diagram to current document
    Set shpDiagram = ActiveSheet.Shapes.AddDiagram( _
        Type:=msoDiagramPyramid, Left:=10, _
        Top:=15, Width:=400, Height:=475)

    'Add first child diagram node
    Set dgnNode = shpDiagram.DiagramNode.Children.AddNode

    'Add three more nodes
    For intCount = 1 To 3
        dgnNode.AddNode
    Next intCount

End Sub