I´m trying to modify ChartData (values) in Powerpoint by using Excel-VBA. The ChartData is not linked to the other Excel Workbook.
Checks: - PowerPoint is open - required Presentation is open - The Chart is on Slide 4
Behavior: - Chart Title Changes - Workbook with ChartData opens - Runtime Error '424' : Objeckt Required - Debugging marks the following line:
Chart.ChartData.Workbook.Worksheets("Tabelle1").Range("B2:B5").Value = 50
Hope somebody can help me out... :-)
Sub ModifyChartData()
Dim pptApp As Object
Dim pptPres As Presentation
Set pptApp = GetObject(, "PowerPoint.Application")
Set pptPres = pptApp.ActivePresentation
pptPres.Slides(4).Shapes("Diagramm1").Chart.ChartTitle.Text = "Sales Overview"
pptPres.Slides(4).Shapes("Diagramm1").Chart.ChartData.Activate
Chart.ChartData.Workbook.Worksheets("Tabelle1").Range("B2:B5").Value = 50
Workbooks.Close
End Sub