I have written some code that copies a chart and range and pastes them into Powerpoint.
The range pastes as a PNG file. Is there anyway to paste it in OLE form, so that there is a link between the powerpoint and the original excel workbook?
Code:
Sub CreateNewPres()
Dim rng As Excel.Range
Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Dim ppSlide As PowerPoint.Slide
Set rng = ThisWorkbook.ActiveSheet.Range("rng_1")
Set ppApp = New PowerPoint.Application
ppApp.Visible = True
ppApp.Activate
Set ppPres = ppApp.Presentations.Add
Set ppSlide = ppPres.Slides.Add(1, ppLayoutTitle)
ppSlide.Shapes(1).TextFrame.TextRange = "End of Pilot Presentation"
ppSlide.Shapes(2).TextFrame.TextRange = "Client Name"
Set ppSlide = ppPres.Slides.Add(2, ppLayoutBlank)
ppSlide.Select
rng.Copy
ppSlide.Shapes.Paste
'Here I would like to paste in OLE form. PasteSpecial doesn't seem to work on Mac
Worksheets("Sheet3").ChartObjects(1).Chart.CopyPicture _
Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture
ppSlide.Shapes.Paste
ppSlide.Shapes(1).IncrementLeft -100
End Sub
Any suggestions?
Bookmarks