Show AllShow All

AddNode Method

ShowAddNode method as it applies to the DiagramNodeChildren object.

ShowAddNode method as it applies to the DiagramNode object.

Example

This example adds a node to a diagram node on the active sheet.

Sub DiagramNodeOBJ()

        Dim nodDiagNode As DiagramNode
        Dim shDiagram As Shape

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

        Set nodDiagNode = shDiagram.DiagramNode

        'Add a root node to the diagram.
        nodDiagNode.Children.AddNode

End Sub