0
votes

I'm writing a utility to copy charts and tables from Excel into a Powerpoint presentation. One of the requirements is to be able to paste in one of 3 ways. 2 of them are simple enough. This one I'm having problems with: As an editable chart but with the links deactivated, so the user can format the chart in Powerpoint but changes to the original chart data in Excel won't feed through.

How do I do it?

I've tried just about every Datatype and Link option I can think of, e.g.

activeSlide.Shapes.PasteSpecial DataType:=ppPasteShape, Link:=msoFalse
activeSlide.Shapes.Paste
ppApp.CommandBars.ExecuteMso "PasteSourceFormatting"
activeSlide.Shapes.PasteSpecial DataType:=ppPasteDefault, Link:=msoFalse
activeSlide.Shapes.PasteSpecial DataType:=ppPasteOLEObject, Link:=msoFalse 

The PasteOLEOBject one crashes Excel even with a preceding 5000 DoEvent loop

but it either pastes as a chart that can't be edited in PowerPoint, or a chart that can be edited but remains linked to the source data so it that changes the Powerpoint changes accordingly.

1

1 Answers

0
votes

Cancel request. I found you can break the links to the shape once it's pasted :-

activeSlide.Shapes.Paste
ppApp.CommandBars.ExecuteMso "PasteSourceFormatting"
For intCount = 1 To 5000: DoEvents: Next
activeSlide.Shapes(activeSlide.Shapes.Count).LinkFormat.BreakLink