Consulting

Results 1 to 4 of 4

Thread: Automating "Keep Source Formatting & Embed Workbook (K)" Paste Option

  1. #1
    VBAX Regular
    Joined
    Aug 2010
    Posts
    6
    Location

    Automating "Keep Source Formatting & Embed Workbook (K)" Paste Option

    I want to copy some Excel charts and paste them into a Powerpoint slide in such a way that the charts appear native to PPT (as opposed to being located on a sheet in an embedded Excel workbook) and have the "Edit Data..." context menu option available when you right click on them. If doing this manually, I can copy the chart in Excel and then Right-Click the target slide and select "Keep Source Formatting & Embed Workbook (K)" from Paste Options, which gives the desired result, however I cannot find a way to automate that particular type of paste.

    I have tried:

    Application.CommandBars.ExecuteMso "PasteSourceFormatting" -- creates a native chart, but linked as opposed to embedded
    ActivePresentation.Slides(1).Shapes.Paste / ActivePresentation.Slides(1).Shapes.PasteSpecial ppPasteDefault -- same as above
    ActivePresentation.Slides(1).Shapes.PasteSpecial ppPasteOLEObject,link:=msoFalse -- embeds the workbook object on the slide, putting the chart on a new sheet

    None of the above methods end with the scenario I explained above. If anyway has any other ideas, I'd really like to hear them. I am using Office 2010, by the way.

    Thanks!

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    You could try

    Application.CommandBars.ExecuteMso "PasteExcelChartDestinationTheme"

    OR

    Application.CommandBars.ExecuteMso "PasteExcelChartSourceFormatting"
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Regular
    Joined
    Aug 2010
    Posts
    6
    Location
    Thank you so much, John! PasteExcelChartSourceFormatting appears to be exactly what I was looking for; I had dome a good bit of trial-and-error with custom mso ID strings, having been unable to find a list of them anywhere, but didn't find anything useful. Do you have, or can you link me to, a full list of ID strings for Office 2010?

    Cheers.

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    I can't remember the link on MSDN but you can get them on our site.


    HERE
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •