I can't find any way to do this. What I have now is that it copy the range as an image:
Dim XLApp As Excel.Application
Dim PPSlide As Slide
Set XLApp = GetObject(, "Excel.Application")
XLApp.Range("A1:B17").Select
XLApp.Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
PPSlide.Shapes.Paste.Select
this works like a charm, but is it possible to get it to copy the range as a table instead of picture?
This can be done simply with
Dim XLApp As Excel.Application
Dim PPSlide As Slide
Set XLApp = GetObject(, "Excel.Application")
XLApp.Range("A1:B17").Copy
PPSlide.Shapes.PasteSpecial DataType:=ppPasteOLEObject, Link:=msoFalse
Well, if I was copying it manually, I would probably do a Paste Special and choose "Formatted Text (RTF)" as the type. I'm sure you can mimic that in VBA.
Aah, here we go. Do this in your powerpoint:
A link to your XL file is now embedded in your PP file. When the data in your XL file changes, you can:
ActivePresentation.UpdateLinks
This is a very different approach than what you were doing first, but I believe it gets you closer to your goal. It has it own problems, though, but those can be worked out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With