Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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
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
Link Powerpoint slide to Excel sheet dkc Excel Discussion (Misc queries) 1 July 26th 07 01:08 PM
how to convert excel worksheet to a powerpoint slide awcrutch Excel Discussion (Misc queries) 1 July 27th 06 05:46 PM
I need to merge text from an Excel doc. into a powerpoint slide? trainer07 Excel Discussion (Misc queries) 1 June 29th 05 07:11 PM
A way to convert Excel worksheet into Powerpoint slide juzion Excel Discussion (Misc queries) 1 June 8th 05 01:38 AM
pasting excel data in a powerpoint slide James Excel Discussion (Misc queries) 4 January 28th 05 02:23 PM


All times are GMT +1. The time now is 03:57 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"