ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   DiagramOrgChart in text (https://www.excelbanter.com/excel-programming/348057-diagramorgchart-text.html)

zenis

DiagramOrgChart in text
 
I've been trying to create an organization chart diagram
using VBA, but generate an error whenever I try to set the
text for a node. This is a sample of my code:


Dim shDiagram as Shape
Dim nodRoot As DiagramNode
Set shDiagram = ActiveSheet.Shapes.AddDiagram( _
Type:=msoDiagramOrgChart, Top:=10, _
Left:=15, Width:=400, Height:=475)
Set nodRoot = shDiagram.DiagramNode.Children.AddNode
nodRoot.TextShape.TextFrame.Characters.Text = "First Node" <-


When I get to the last line, an exception is thrown
stating "Unable to set the text property of the Characters
class".


Any idea why?




All times are GMT +1. The time now is 06:19 AM.

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