Sub ExcelToNewPowerPoint2()
Dim objPPT As PowerPoint.Application
Dim objPres As PowerPoint.Presentation
Dim objSlide As PowerPoint.Slide
Dim objCustomLayout As PowerPoint.CustomLayout
Dim objShape As PowerPoint.Shape
Dim strText As String
Set objPPT = CreateObject("Powerpoint.Application")
Set objPres = objPPT.Presentations.Add
Set objCustomLayout = objPres.SlideMaster.CustomLayouts.Item(1)
Set objSlide = objPres.Slides.AddSlide(1, objCustomLayout)
objSlide.Layout = PowerPoint.PpSlideLayout.ppLayoutText
Set MSChart1 = objPres.Slides(1).Shapes.AddChart(xlXYScatterLines, 100, 100,
500, 400)
'Change the contents of the data used by the PowerPoint Chart
ActiveWorkbook.Sheets("Sheet1").Range("A2") = 23
ActiveWorkbook.Sheets("Sheet1").Range("A1").Activate
ActiveCell.Offset(1, 1).FormulaR1C1 = "=[ExcelPPT.xlsm]Sheet5!RC[1]"
ActiveWindow.Close
End Sub
-------------------------------------------------
Steve Rindsberg said:
I'm currently building custom UI in PowerPoint that links to VBA macros etc.
My questions is regarding the default charts in PowerPoint 2007.
How do you access charts and the elements of them through VBA within
PowerPoint?
This is one of those "I'm glad to have the answer but only because it means I
can stop banging my head on the desk over this" kind of answers.
You can't.
How's that for "short but not sweet"? :-(
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:
www.pptfaq.com
PPTools:
www.pptools.com
================================================