Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Diagram
How can I get
Insert Diagram to function when the Macro Recorder is turned on? -- Gary's Student |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Diagram
I doubt there is a way.
Are you just trying to discover the objects associated with that activity? the shapes collection has an adddiagram method. -- Regards, Tom Ogilvy "Gary''s Student" wrote: How can I get Insert Diagram to function when the Macro Recorder is turned on? -- Gary's Student |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Diagram
Thank you Tom,
I am just trying to insert one of the pre-canned diagrams via VBA. -- Gary''s Student "Tom Ogilvy" wrote: I doubt there is a way. Are you just trying to discover the objects associated with that activity? the shapes collection has an adddiagram method. -- Regards, Tom Ogilvy "Gary''s Student" wrote: How can I get Insert Diagram to function when the Macro Recorder is turned on? -- Gary's Student |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Diagram
Sub AddPyramid()
Dim obj As Shape With Range("B5:J25") Set obj = ActiveSheet.Shapes.AddDiagram( _ Type:=msoDiagramPyramid, _ Top:=.Top, _ Left:=.Left, _ Width:=.Width, _ Height:=.Height) Set nd = obj.DiagramNode.Children.AddNode End With For i = 1 To 2 nd.AddNode Next End Sub adds the pyramid. I think you will have to play around with the object model for these to figure out how to get the basic "node" for each type (beyond changing the type property). Also, I believe these were added in xl2003, so not available in earlier versions. -- Regards, Tom Ogilvy "Gary''s Student" wrote: Thank you Tom, I am just trying to insert one of the pre-canned diagrams via VBA. -- Gary''s Student "Tom Ogilvy" wrote: I doubt there is a way. Are you just trying to discover the objects associated with that activity? the shapes collection has an adddiagram method. -- Regards, Tom Ogilvy "Gary''s Student" wrote: How can I get Insert Diagram to function when the Macro Recorder is turned on? -- Gary's Student |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Diagram
Thank you very much Tom.
The sub works perfectly. I'll now work on figuring out how to enter text. This is a major help to me since my original approach was to embed Visio objects; that approach falls flat on its face when tried on computers not having Visio. -- Gary''s Student "Tom Ogilvy" wrote: Sub AddPyramid() Dim obj As Shape With Range("B5:J25") Set obj = ActiveSheet.Shapes.AddDiagram( _ Type:=msoDiagramPyramid, _ Top:=.Top, _ Left:=.Left, _ Width:=.Width, _ Height:=.Height) Set nd = obj.DiagramNode.Children.AddNode End With For i = 1 To 2 nd.AddNode Next End Sub adds the pyramid. I think you will have to play around with the object model for these to figure out how to get the basic "node" for each type (beyond changing the type property). Also, I believe these were added in xl2003, so not available in earlier versions. -- Regards, Tom Ogilvy "Gary''s Student" wrote: Thank you Tom, I am just trying to insert one of the pre-canned diagrams via VBA. -- Gary''s Student "Tom Ogilvy" wrote: I doubt there is a way. Are you just trying to discover the objects associated with that activity? the shapes collection has an adddiagram method. -- Regards, Tom Ogilvy "Gary''s Student" wrote: How can I get Insert Diagram to function when the Macro Recorder is turned on? -- Gary's Student |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Diagram | Excel Discussion (Misc queries) | |||
how do I colour my diagram? | Excel Discussion (Misc queries) | |||
insert diagram | Excel Discussion (Misc queries) | |||
Diagram | Excel Discussion (Misc queries) | |||
how do i make a pxy diagram? | Excel Discussion (Misc queries) |