Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using excel vba to produce a powerpoint slide
Hi,
I am writing a vba program to open powerpoint and produce a new slide based on a column chart with data labels - I have amanged to open powerpoint and insert a new slide of the right type, however I cannot access the chart on the page to change the chart options etc as well as getting to the data sheet behind it. Has anyone got any ideas? Please see the code that I have at the moment below Many thanks KDUT ' Change this to the auto layout you want to use. This value can be ' any PpSlideLayout constant. Const DEFAULT_AUTO_LAYOUT As Long = ppLayoutChart ' Get the number of slides in the active presentation. lLastSlide = oPPTApp.ActivePresentation.Slides.Count lLastSlide = lLastSlide + 1 oPPTApp.ActivePresentation.Slides.Add lLastSlide, DEFAULT_AUTO_LAYOUT Dim oPPTShape As PowerPoint.Shape Dim rngNewRange As Excel.Range Dim oGraph As Object With oPPTApp.ActivePresentation.Slides(lLastSlide) With .Shapes(1) With .TextFrame.TextRange .Text = chart_title .Font.Name = "Arial" .Font.Size = 24 End With End With ......... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using excel vba to produce a powerpoint slide
Hi,
Yes, PowerPoint uses an application called MS Graph for graphing. You will need to set a separate referrence to MicroSoft Graph 9.0 library, or the highest version you have. (from the IDE choose Tools, References). That will give you access to the object model for MS Graph. You need one set for Graph and one for PowerPoint. PowerPoint alone isn't enough. Query MS Graph on the MicroSoft web site. There are several informative articles with code samples that will help. Mike -----Original Message----- Hi, I am writing a vba program to open powerpoint and produce a new slide based on a column chart with data labels - I have amanged to open powerpoint and insert a new slide of the right type, however I cannot access the chart on the page to change the chart options etc as well as getting to the data sheet behind it. Has anyone got any ideas? Please see the code that I have at the moment below Many thanks KDUT ' Change this to the auto layout you want to use. This value can be ' any PpSlideLayout constant. Const DEFAULT_AUTO_LAYOUT As Long = ppLayoutChart ' Get the number of slides in the active presentation. lLastSlide = oPPTApp.ActivePresentation.Slides.Count lLastSlide = lLastSlide + 1 oPPTApp.ActivePresentation.Slides.Add lLastSlide, DEFAULT_AUTO_LAYOUT Dim oPPTShape As PowerPoint.Shape Dim rngNewRange As Excel.Range Dim oGraph As Object With oPPTApp.ActivePresentation.Slides(lLastSlide) With .Shapes(1) With .TextFrame.TextRange .Text = chart_title .Font.Name = "Arial" .Font.Size = 24 End With End With ......... . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Link Powerpoint slide to Excel sheet | Excel Discussion (Misc queries) | |||
how to convert excel worksheet to a powerpoint slide | Excel Discussion (Misc queries) | |||
I need to merge text from an Excel doc. into a powerpoint slide? | Excel Discussion (Misc queries) | |||
A way to convert Excel worksheet into Powerpoint slide | Excel Discussion (Misc queries) | |||
pasting excel data in a powerpoint slide | Excel Discussion (Misc queries) |