Export (0) Print
Expand All
Expand Minimize

Root Property [Excel 2003 VBA Language Reference]

Office 2003

Returns the root DiagramNode object which the root diagram node belongs.


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


The following example creates an organization chart and adds child nodes to the root diagram node.

Sub AddChildNodesToRoot()

    Dim nodDiagram As DiagramNode
    Dim shDiagram As Shape
    Dim intCount As Integer

    Set shDiagram = ActiveSheet.Shapes.AddDiagram _
        (Type:=msoDiagramOrgChart, Left:=10, Top:=15, _
        Width:=400, Height:=475)

    ' Add the first node to the diagram.

    ' Establish the first node as the root.
    Set nodDiagram = shDiagram.DiagramNode.Root

    ' Add three modes to the diagram.
    For intCount = 1 To 3
    Next intCount

End Sub

Applies to | DiagramNode Object

© 2014 Microsoft