K
KDUT
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
.........
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
.........