I am trying to create a VBA code which can help me open a presentation, go to each slide, check for a chart and then copy its min and max value in an excel sheet. I have a 40+ slides presentation with multiple chart and this code will help me to check if the axis values in all the chart are consistent. Below is the code I am working on. So far, able to open the presentation but not able to open the chart and copy the values to excel. Please help, new to VBA coding
Sub CopySlidechart()
Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Dim ppSlide As PowerPoint.Slide
Dim ppPlaceHolder As PowerPoint.Shape
Dim oRow As Long
Set ppApp = CreateObject("PowerPoint.Application")
Set ppApp = New PowerPoint.Application
ppApp.Visible = msoTrue
Dim input_path As String
input_path = ThisWorkbook.Worksheets("Sheet1").Range("B1")
Set ppPres = ppApp.Presentations.Open(input_path)
oRow = 6
For Each ppSlide In ppPres.Slides
For Each ppPlaceHolder In ppSlide.Shapes
If ppPlaceHolder.HasChart Then
ThisWorkbook.Worksheets("Sheet1").Range(oRow, "B").Value = ChartObject.Chart.Axes(xlCategory).MaximumScale
ThisWorkbook.Worksheets("Sheet1").Cells(oRow, "C").Value = ChartObject.Chart.Axes(xlCategory).MinimumScale
oRow = oRow + 1
oRow = oRow + 1
Exit For
End If
Next ppPlaceHolder
Next ppSlide
End Sub