VBA To Copy Multiple Charts from Excel 2013 and Paste Into PowerPoint 2013

nroehm03

New Member
Joined
Apr 11, 2013
Messages
10
I am trying to copy multiple charts from an excel workbook and paste them in PowerPoint using VBA. The code below pastes each chart into its own separate page. I would like to fit 4 charts per page in PowerPoint of equal size.

Thanks for the help - Nick


Const ppLayoutBlank = 2
Const ppViewSlide = 1


Sub ExportChartstoPowerPoint()
Dim PPApp As Object
Dim chr
Set PPApp = CreateObject("PowerPoint.Application")
PPApp.Presentations.Add
PPApp.ActiveWindow.ViewType = ppViewSlide
For Each chr In Sheets("Summary").ChartObjects
PPApp.ActivePresentation.Slides.Add PPApp.ActivePresentation.Slides.Count + 1, ppLayoutBlank
PPApp.ActiveWindow.View.GotoSlide PPApp.ActivePresentation.Slides.Count
chr.Select
ActiveChart.CopyPicture Appearance:=xlScreen, Size:=xlScreen, 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
End Sub
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hey Guys,

I have 8 Charts in an excel tab named "Summary", I want to copy and paste the charts from excel into PowerPoint using VBA.

I would like 4 charts on each slide, all the same width and height.

I am having trouble with the VBA, any help would be greatly appreciated.

thank you,

Nick
 
Upvote 0

Forum statistics

Threads
1,196,374
Messages
6,014,900
Members
441,854
Latest member
Amstaff

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