Best Way to Copy Excel Table into PowerPoint (2010)?

后端 未结 2 1037
有刺的猬
有刺的猬 2021-01-16 08:47

I\'m trying to get a series of Excel tables into PowerPoint and successfully created a macro for this in Office 2013, but am trying to adapt it to Office 2010.

The i

2条回答
  •  清歌不尽
    2021-01-16 09:23

    The long/numeric equivalent for ppPasteHtml is 8. You can query this for yourself by opening up the VBE in PowerPoint, and doing ?ppPasteHTML in the Immediate window, or Debug.Print ppPasteHtml in a module/routine.

    Using early binding, try:

    pptSlide.Shapes.PasteSpecialy DataType:=ppPasteHtml
    

    Or, using late binding:

    pptSlide.Shapes.PasteSpecial DataType:=8
    

    Alternatively, I have seen a few other q's where people have problems pasting from one application to another application (e.g., from Excel to PowerPoint etc.) In those cases, it seems that sometimes the only way to resolve is to use the CommandBars object, however I am not sure if there is an "HTML" paste method from CommandBars.

    pptSlide.Parent.ExecuteMso "PasteExcelTableSourceFormatting"
    

    Here are some other possible MSO commands you could use, but like I said I don't see one that appears to paste HTML, although this list is for Office 2010:

    enter image description here

提交回复
热议问题