Export (0) Print
Expand All
R
Expand Minimize

Root Property [Excel 2003 VBA Language Reference]

Office 2003

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

expression.Root

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

Example

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.
    shDiagram.DiagramNode.Children.AddNode

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

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

End Sub
		


Applies to | DiagramNode Object


Show:
© 2014 Microsoft