Paste Excel Range into Powerpoint as Table

柔情痞子 提交于 2020-02-07 09:07:09

问题


I am trying to write get write a macro in excel to copy a range of cells from excel to powerpoint. However, I can't seem to figure out the line to paste the range into powerpoint as a table (like right clicking and hitting 'paste') in powerpoint.

I tried Activesheet.shapes.paste but that gave me an error about data type

I also tried Activesheet.shapes.pastespecial, but none of the options are for pasting as a table as far as I can tell. I do not want to paste as a picture or anything like that.

Any ideas?


回答1:


James - check this out: http://www.thespreadsheetguru.com/blog/2014/3/17/copy-paste-an-excel-range-into-powerpoint-with-vba

It looks like the relevant code snippet from this post is the following:

'Copy Range from Excel
  Set rng = ThisWorkbook.ActiveSheet.Range("A1:D12")

'Copy Excel Range
 rng.Copy

'Paste to PowerPoint and position
 mySlide.Shapes.PasteSpecial DataType:=ppPasteEnhancedMetafile
 Set myShapeRange = mySlide.Shapes(mySlide.Shapes.Count)


来源:https://stackoverflow.com/questions/26782220/paste-excel-range-into-powerpoint-as-table

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!