Microsoft Office Tutorials and References
In Depth Information
Figure A-8. The Diagram object and its children
Figure A-8 shows the portion of the Excel XP object model devoted to the Diagram object.
Figure A-8. The Diagram object and its children
Table A-2 shows the members of the Diagram object.
Table A-2. Members of the Diagram ob ject
Application
Convert
Parent
AutoFormat
Creator
Reverse
AutoLayout
Nodes
Type
The members of the DiagramNode object are a bit more interesting, as shown in Table A-3 .
Table A-3. Members of the Dia gramNode object
AddNode
Diagram
ReplaceNode
Application
Layout
Root
Children
MoveNode
Shape
CloneNode
NextNode
SwapNode
Creator
Parent
TextShape
Delete
PrevNode
TransferChildren
Of course, the DiagramNodeChildren object represents the collection of Diagram nodes that are
children of a specific node. The DiagramNodeChildren object's members are shown in Table A-4 .
Table A-4. Memb ers of the DiagramNodeChil dren object
_NewEnum
Creator
Parent
AddNode
FirstChild
SelectAll
Application
Item
Count
LastChild
We can use the Children property of the DiagramNode object to return this collection object. For
instance, to get the last child of a node, we can write:
ActiveSheet.Shapes(1).Diagram.Nodes(1).Children.LastChild
Unfortunately, the programmatic aspects of the Diagram-related objects do not seem to be
functioning correctly (as of Service Pack 1 of Excel XP), as we will see shortly.
To create a diagram programmatically, we use the AddDiagram method of the Shapes collection
of the worksheet. The following code creates the diagram in Figure A-6 . Note, however, that there
 
 
 
 
 
 
 
Search JabSto ::




Custom Search