none
Copy & Paste Excel range to PowerPoint keep source formatting RRS feed

  • Question

  • Hello,

    I am using VBA.

    I need  to copy a range from Excel and paste is with "keep source formatting" (so it will be editable).

    Using just paste does not work.

    Using the following code returns error (although manually I can paste as HTML):

    Set objShape = pptSlide.Shapes.PasteSpecial DataType:=ppPasteHTML
    It seems that ppPasteHTML or 8 is not reconized in Excel 2016.

    The only thing that is working is:

    pptApp.CommandBars.ExecuteMso("PasteSourceFormatting");

    In this way it sometimes paste it in a wrong slide and I can't assign the new shape to an object variable (in order to modify its size & location). I trying to assign it to the last shape on the slide but it is not stable.

    I mean I can't write:

    Set objShape =pptApp.CommandBars.ExecuteMso("PasteSourceFormatting");

    I don't understand how to implement this simple task.

    Can you help me ?

    Thank you











    • Edited by Avisam Friday, August 10, 2018 9:54 AM
    Friday, August 10, 2018 9:52 AM