Sub FixAllChartsinPPTandExtractData()
Dim oSl As PowerPoint.Slide
Dim oSh As PowerPoint.Shape
Dim ppApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim sr As Integer
Dim BaseWks As Worksheet
Dim maxval, minval As Double
Set ppApp = New PowerPoint.Application
FILENAME = Application.GetOpenFilename("PPT, PPTx, PPS and PPSx,*.pp*", 1, "Select Powerpoint file", , 0)
Set PPPres = GetObject(FILENAME)
Set BaseWks = Workbooks.Add(xlWBATWorksheet).Worksheets(1)
BaseWks.Activate
For Each oSl In PPPres.Slides
For Each oSh In oSl.Shapes
ActiveSheet.Cells.Clear
If oSh.Type = msoChart Then
sr = oSh.Chart.SeriesCollection.Count
For j = 1 To sr
With oSh.Chart.SeriesCollection(j)
.Format.Line.Weight = 1
.Format.Line.Style = msoLineSingle
.MarkerStyle = xlMarkerStyleNone
vntData = .Values
vntLabels = .XValues
For lngIndex = LBound(vntData) To UBound(vntData)
ActiveSheet.Cells(lngIndex, 0 + j) = vntData(lngIndex)
Next
End With
Next
ActiveSheet.Cells(2000, 2000) = "=-1*MROUND((-1*MAX(A:Z))-2,5)"
maxval = Cells(2000, 2000).Value
ActiveSheet.Cells(2000, 2000) = "=-1*MROUND((-1*MIN(A:Z))+2,5)"
minval = Cells(2000, 2000).Value
With oSh.Chart.Axes(xlValue)
.MinimumScaleIsAuto = False
.MinimumScale = minval
.MaximumScaleIsAuto = False
.MaximumScale = maxval
.MinorUnitIsAuto = True
.MajorUnit = 5
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
oSh.Chart.PlotArea.Interior.Color = vbWhite
oSh.Chart.ChartArea.Interior.Color = vbWhite
oSh.Chart.ChartTitle.Font.Color = vbBlack
oSh.Chart.ChartArea.Font.Color = vbBlack
End If
Next
Next
BaseWks.Parent.Close True
End Sub