View Single Post
 
Old 02-11-2014, 05:57 PM
5amuel 5amuel is offline Windows XP Office 2007
Novice
 
Join Date: Jul 2013
Posts: 3
5amuel is on a distinguished road
Question Paste Excel chart with embeded workbook: PowerPoint for Mac

Hi
The following VBA code pastes Excel graphs to PowerPoint with the *workbook embeded* (same as clicking Paste Special -> Keep source formatting and embed workbook.

Can anyone assist in translating this code into Excel for Mac 2011? It breaks on "ExecuteMso"

Code:
Public PPApp As PowerPoint.Application
Public PPPres As PowerPoint.Presentation
Public PPSlide As PowerPoint.Slide
Sub ExcelToExistingPowerPoint()
    ActiveSheet.Select
    ActiveSheet.Copy
    ActiveSheet.Shapes(xChart).Copy
    Set PPSlide = PPPres.Slides.Add(PPPres.Slides.Count + 1, 2)
    PPSlide.CustomLayout = PPPres.Designs(1).SlideMaster.CustomLayouts(2)
    PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
    PPSlide.Shapes.Placeholders(3).Select msoTrue
    PPApp.CommandBars.ExecuteMso "PasteExcelChartSourceFormatting"
End Sub
Thanks in advance!
Reply With Quote