Hello All,
Below is some code that I currently use that works perfectly to copy preformatted data in Excel to PowerPoint. However, the data pasted into PowerPoint from Excel is a picture and I would like it to be a linked object. For instance, if I manually copy the data from Excel and, once in PowerPoint, Paste Special (ctrl+alt+v) and select Paste Link --> "Microsoft Excel Worksheet (code) Object"... I get exactly what I want.
'Copy to PowerPoint and format
Dim PPT As PowerPoint.Application
Dim pptPres As PowerPoint.Presentation
Dim pptSld As PowerPoint.Slide
Dim XLR As Range
Set PPT = CreateObject("PowerPoint.Application")
If PPT.Visible = msoTrue Then
Set pptPres = PPT.Presentations("H:\FPA\Global Corp Reforecast - test\Q1 2013 Package test.pptx")
Else
PPT.Presentations.Open ("H:\FPA\Global Corp Reforecast - test\Q1 2013 Package test.pptx")
Set pptPres = PPT.Presentations("H:\FPA\Global Corp Reforecast - test\Q1 2013 Package test.pptx")
End If
Set pptSld = pptPres.Slides(8)
pptSld.Shapes("Global Reforecast Presentation object").Delete
Set XLR = Sheets("AM Page (2)").Range("A2", Range("A3").End(xlDown).End(xlToRight))
XLR.CopyPicture Format:=xlPicture, Appearance:=xlScreen
With pptSld.Shapes.Paste
.Left = 66
.Top = 55
.LockAspectRatio = msoFalse
.Width = 851.76
.Height = 470.16
.Name = "Global Reforecast Presentation object"
End With
Please note: I have already tried
XLR.Copy
With pptSld.Shapes.pastespecial(ppPasteOLEObject)
This bloats the file size to over 100mb (I have 22 slides to perform this operation on).
Many thanks in advance.
Bjordion
Bookmarks