DiagramNode Object [Excel 2003 VBA Language Reference]

Multiple objects
DiagramNode
Multiple objects

Represents a node in a diagram.

Using the DiagramNode object

Use the AddNode method to add a node to a diagram or to a diagram node. This example assumes the third shape in the active worksheet is a diagram and adds a node to it.

Sub AddDiagramNode()
    ActiveSheet.Shapes(3).DiagramNode.Children.AddNode
End Sub

Use the Delete method to remove a node from a diagram or diagram node. This example assumes the second shape in the active worksheet is a diagram and removes the first node from it.

Sub DeleteDiagramNode()
    ActiveSheet.Shapes(2).DiagramNode.Children(1).Delete
End Sub

To return a DiagramNode object, use one of the following:

  • The DiagramNode object's AddNode, CloneNode, NextNode or PrevNode methods, or Root property
  • The DiagramNodeChildren collection's AddNode or Item methods, or FirstChild or LastChild properties
  • The DiagramNodes collection's Item method
  • The Shape object's or ShapeRange collection's DiagramNode property

A diagram node can terminate, or contain other child diagrams, child diagram nodes, or child shapes:

  • To refer to a child diagram, use the Diagram property.
  • To refer to an individual child diagram node, use the AddNode, CloneNode, NextNode or PrevNode methods, or Root property.
  • To refer to a collection of child diagram nodes, use the Children property.
  • To refer to a shape, use the Shape or TextShape properties.

Properties | Application Property | Children Property | Creator Property | Diagram Property | Layout Property | Parent Property | Root Property | Shape Property | TextShape Property

Methods | AddNode Method | CloneNode Method | Delete Method | MoveNode Method | NextNode Method | PrevNode Method | ReplaceNode Method | SwapNode Method | TransferChildren Method

Parent Objects | DiagramNode Object | DiagramNodeChildren Object | Shape Object | ShapeRange Collection

Child Objects | DiagramNode Object | DiagramNodeChildren Object | Shape Object

See Also | DiagramNode Property | DiagramNodeChildren Collection | DiagramNodes Collection