Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>What you need to do is invoke the PasteSpecial "Keep Source Formatting and Embed Workbook".</p> <p><img src="https://i.stack.imgur.com/mqo3I.jpg" alt="enter image description here"></p> <p>Assume you have already created the charts, and the slides, placeholders/etc., and you have already copied the chart and navigated to the destination slide, and that you have an object like <code>PPTApp</code> to represent the <code>PowerPoint.Application</code> object.</p> <p>Instead of using the <code>Shapes.PasteSpecial</code> method, you can do this:</p> <pre><code>PPTApp.CommandBars.ExecuteMso "PasteExcelChartSourceFormatting" </code></pre> <p>This does not create a link to the Excel document, it embeds a local copy of the document in the PowerPoint Presentation. I think I understand this is your requirement.</p> <p><strong>Update from comments</strong></p> <p>Documentation on the <code>ExecuteMso</code> method:</p> <p><a href="http://msdn.microsoft.com/en-us/library/office/ff862419.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/office/ff862419.aspx</a></p> <p>Downloadable document containing the <code>idMSO</code> parameters for each Office Application:</p> <p><a href="http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&amp;id=6627" rel="nofollow noreferrer">http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&amp;id=6627</a></p> <p><strong>NOTE:</strong> If you want to do something with the pasted chart after <code>.ExecuteMso</code> you may need to check if the shape is already pasted because <code>.ExcecuteMso</code> is asynchronous (the macro doesn't know when it's finished). Another question shows you how to <a href="https://stackoverflow.com/questions/33711293/powerpoint-vba-does-not-recognize-excel-table-during-run">wait for its completion</a> .</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload