I have total 70 slides which I am getting by changing the slicer, My code is working to open ppt (which is backdated chart from excel) delete the previous object change slicer and add the chart then copy-paste the charts in ppt. The issue is that 70 slides is pasting after 1st 70 slides. because it is already having a title and footer. Instead of 70 I am getting 140 slides.1st 70 with title and footer and next 70 which is newly pasted. I want to update these 70 slides in last month's ppt. (keeping the remaining title footer as it is)
For Each chr in Sheets("tab1").ChartObjects
ppApp.Activepresentation.Slides.Add ppApp.ActivePresentation.slides.Count
ppApp.ActiveWindow.View.GotoSlide ppApp.AvtivePresentation.Slides.Count
chr.Select
With ActiveChart.Parent
.Height= 500
.Width=900
End With
ActiveChart.CopyPicture
Appearance:=xlScreen,Size:=xlPrinter,Format"=xlPicture
ppApp.ActiveWindow.View.Paste
ppApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,True
ppApp.ActiveWindow.Selection.ShapeRange.Align msoAlignmiddles,True
Next chr
ppApp.Visible=True
Next item
For Each chr in Sheets("tab1").ChartObjects
ppApp.Activepresentation.Slides.Add ppApp.ActivePresentation.slides.Count
ppApp.ActiveWindow.View.GotoSlide ppApp.AvtivePresentation.Slides.Count
chr.Select
With ActiveChart.Parent
.Height= 500
.Width=900
End With
ActiveChart.CopyPicture
Appearance:=xlScreen,Size:=xlPrinter,Format"=xlPicture
ppApp.ActiveWindow.View.Paste
ppApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,True
ppApp.ActiveWindow.Selection.ShapeRange.Align msoAlignmiddles,True
Next chr
ppApp.Visible=True
Next item