Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default organization chart

I am unable to set the Text in each Diagram Node of an organization chart
using Excel 2003 VBA code.

I have tried the Excel VBA Help example that accompanies the TextShape
Property, and this too fails with error 1004, "Unable to set the Text
property of the Characters class".
  #2   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default organization chart

I tried this and it seems to work:

Public Sub Temp1()
Sheets("Sheet1").Shapes("Rectangle 2").Select
Selection.Font.Size = 25
End Sub

I have a rectangle with text in it call "Rectangle 2".
For some reason this doesn't seem to work in a "with block".

Art
"Alan Olney" wrote:

I am unable to set the Text in each Diagram Node of an organization chart
using Excel 2003 VBA code.

I have tried the Excel VBA Help example that accompanies the TextShape
Property, and this too fails with error 1004, "Unable to set the Text
property of the Characters class".

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default organization chart

I can get it to work for text boxes, but not for Org Charts.

Here is the MS Excel VBA Help article and example that I have tried that
illustrates the problem:

TextShape Property
See AlsoApplies ToExampleSpecificsReturns a Shape object representing the
shape of the text box associated with a diagram node.

expression.TextShape
expression Required. An expression that returns one of the objects in the
Applies To list.

Example
The following example adds child nodes to a parent node, and displays text
in the parent node indicating the number of child nodes created.

Sub CountChildNodes()

Dim nodRoot As DiagramNode
Dim shDiagram As Shape
Dim intCount As Integer
Dim shText As Shape

Set shDiagram = ActiveSheet.Shapes.AddDiagram _
(Type:=msoDiagramRadial, Left:=10, Top:=15, _
Width:=400, Height:=475)
Set nodRoot = shDiagram.DiagramNode.Children.AddNode

' Add 3 child nodes to the root node.
For intCount = 1 To 3
nodRoot.Children.AddNode
Next

' Change text in node.
For intCount = 1 To 4
Set shText = shDiagram.DiagramNode.Children.Item(1).TextShape
shText.TextFrame.Characters.Text = Str(intcount)
Next intCount

End Sub



"Art" wrote:

I tried this and it seems to work:

Public Sub Temp1()
Sheets("Sheet1").Shapes("Rectangle 2").Select
Selection.Font.Size = 25
End Sub

I have a rectangle with text in it call "Rectangle 2".
For some reason this doesn't seem to work in a "with block".

Art
"Alan Olney" wrote:

I am unable to set the Text in each Diagram Node of an organization chart
using Excel 2003 VBA code.

I have tried the Excel VBA Help example that accompanies the TextShape
Property, and this too fails with error 1004, "Unable to set the Text
property of the Characters class".

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
where can I get organization chart add-in for Excel 2000? kturvey Excel Discussion (Misc queries) 1 July 26th 07 05:58 PM
Microsoft Organization Chart Danny Excel Discussion (Misc queries) 2 July 5th 07 02:42 PM
Picture > Organization chart nnamdi elemamba Charts and Charting in Excel 1 March 16th 05 02:51 AM
How do i set up an organization chart in Excel? rox Charts and Charting in Excel 1 December 30th 04 06:11 PM
flickering organization chart Luc Benninger Excel Programming 0 July 27th 04 10:53 AM


All times are GMT +1. The time now is 11:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"