Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Insert Diagram

How can I get

Insert Diagram

to function when the Macro Recorder is turned on?
--
Gary's Student
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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
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
Diagram Kathrine Excel Discussion (Misc queries) 0 March 6th 08 08:56 AM
how do I colour my diagram? sandra Excel Discussion (Misc queries) 1 May 24th 07 02:44 PM
insert diagram Brian Excel Discussion (Misc queries) 5 January 11th 07 12:50 PM
Diagram roffe Excel Discussion (Misc queries) 1 May 14th 06 12:01 AM
how do i make a pxy diagram? dwe1981 Excel Discussion (Misc queries) 0 January 23rd 06 09:03 PM


All times are GMT +1. The time now is 11:41 PM.

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"