24 Replies Latest reply: Aug 13, 2016 2:04 PM by Grant Rudachyk RSS

    Macro to Copy & Paste table into Powerpoint using paste special

    Grant Rudachyk

      Hello,

           I'm hoping someone has experience pasting tables into Powerpoint using paste special. I've had success using CopyToBitmapToClipboard using the following code:

      ActiveDocument.GetSheetObject("CH418").CopyBitmapToClipboard

      PPSlide.Shapes.Paste.Select

       

      I would like to paste in an editable table instead of an image and I thought something like this code would work:

      ActiveDocument.GetSheetObject("CH418").CopyTableToClipboard True

      PPSlide.Shapes.PasteSpecial(PasteHTML).Select

       

      However, I get the following error:

      Shapes.PasteSpecial : Invalid request.  Clipboard is empty or contains data which may not be pasted here.

       

      I confirmed that the Clipboard was not empty by manually pasting from it into Powerpoint. I also tried PasteDefault instead of PasteHTML.

       

      The PasteSpecial works with CopyBitmapToClipboard. The example below worked so I think some form of PasteSpecial should work for straight tables:

       

      ActiveDocument.GetSheetObject("CH418").CopyBitmapToClipboard

      PPSlide.Shapes.PasteSpecial(PasteEnhancedMetafile).Select

       

      If anyone has any insights, it would be greatly appreciated. I am using version 10.

       

      thanx

      Grant