I want to copy paste chart as a object in PPT in which titale header and footer is already there using excel vba

sanju1988

New Member
Joined
Jun 12, 2022
Messages
10
Office Version
  1. 2021
  2. 2019
  3. 2016
Platform
  1. Windows
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
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top