scott56
08-11-2010, 01:56 PM
Hi,
I have been trying to achieve a VBA version of a manual process when copying a chart from Excel to Powerpoint.
The manual process works by selecting a chart in Excel, copying that chart into Powerpoint. Selected Paste Special in Powerpoint and then Paste Link of the Excel Chart Object. When it is pasted this way in Powerpoint you are able to edit and modify the chart while the link is in place. When the link is broken the Chart becomes a picture that cannot have it's chart type modified.
In the code snippet below the copy that I perform with VBA does copy the chart across to the powerpoint file as a chart object with a link. But when the links are broken the copied chart in Powerpoint remains a chart object that can be modified and is not a picture.
In the final version of this I want to remove the possibility of changing the chart type so that the released powerpoint looks the same
myWorkbook.Sheets(1).Select
'Copy as a picture but does not have a transparent background
'myWorkbook.ActiveChart.CopyPicture Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture
'pptSlide.Shapes.Paste.Select
'Copy as a chart but must have a link included that needs to be broken later
myWorkbook.ActiveChart.ChartArea.Copy
pptSlide.Shapes.PasteSpecial(ppPasteDefault).Select
I have attached a word document that describes the manual process.
Any help appreciated...
I have been trying to achieve a VBA version of a manual process when copying a chart from Excel to Powerpoint.
The manual process works by selecting a chart in Excel, copying that chart into Powerpoint. Selected Paste Special in Powerpoint and then Paste Link of the Excel Chart Object. When it is pasted this way in Powerpoint you are able to edit and modify the chart while the link is in place. When the link is broken the Chart becomes a picture that cannot have it's chart type modified.
In the code snippet below the copy that I perform with VBA does copy the chart across to the powerpoint file as a chart object with a link. But when the links are broken the copied chart in Powerpoint remains a chart object that can be modified and is not a picture.
In the final version of this I want to remove the possibility of changing the chart type so that the released powerpoint looks the same
myWorkbook.Sheets(1).Select
'Copy as a picture but does not have a transparent background
'myWorkbook.ActiveChart.CopyPicture Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture
'pptSlide.Shapes.Paste.Select
'Copy as a chart but must have a link included that needs to be broken later
myWorkbook.ActiveChart.ChartArea.Copy
pptSlide.Shapes.PasteSpecial(ppPasteDefault).Select
I have attached a word document that describes the manual process.
Any help appreciated...