ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I add nodes to child nodes of a radial diagram? (https://www.excelbanter.com/excel-programming/415996-how-do-i-add-nodes-child-nodes-radial-diagram.html)

jmDesktop

How do I add nodes to child nodes of a radial diagram?
 
I found this code on MSDN for an org chart and it works fine, but if I
change the type to msoDiagramRadial it fails:

Dim dgnRoot As DiagramNode
Dim shpDiagram As Shape
Dim dgnNext As DiagramNode
Dim intCount As Integer

'Add organization chart to current document
Set shpDiagram = ActiveSheet.Shapes.AddDiagram( _
Type:=msoDiagramOrgChart, Left:=10, _
Top:=15, Width:=400, Height:=475)

'Add three child nodes to organization chart
Set dgnRoot = shpDiagram.DiagramNode.Children.AddNode

For intCount = 1 To 3
dgnRoot.Children.AddNode
Next

'Access the node immediately following
'the first diagram node
Set dgnNext = dgnRoot.Children.Item(1).NextNode

'Add three child nodes to the node immediately
'following the first diagram node
For intCount = 1 To 3
dgnNext.Children.AddNode
Next intCount

I wanted the same chart, but as radial. I left the msoDiagramOrgChart
so you could see what I originally had. Does msoDiagramRadial support
child nodes on it leaves? When I change it above I just get
"Permission Denied." Strange error, but I believe it may not support
it.

Thank you for any help.



All times are GMT +1. The time now is 01:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com