Question posted 2010 · +4 upvotes
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?
Accepted answer +7 upvotes
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
VBA Core objects referenced (5)
Application— Using events with the Application objectApplication— Working with Other ApplicationsPPSlide.Shapes— Working with shapes (drawing objects)PPSlide.Shapes— Events, Worksheet Functions, and ShapesPaste.Select— Select a Range
Top vba Q&A (6)
- Difference between Visual Basic 6.0 and VBA +122 (2009)
- VBA – how to conditionally skip a for loop iteration +116 (2011)
- VBA: Test if string begins with a string? +53 (2013)
- html parsing of cricinfo scorecards +47 (2012)
- Code to loop through all records in MS Access +46 (2011)
- Access VBA | How to replace parts of a string with another string +44 (2011)
vba solutions on this site
.