How do I add nodes to child nodes of a radial diagram?

J

jmDesktop

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top