Code to copy chart

  • Thread starter Thread starter Pedro
  • Start date Start date
P

Pedro

Hi,
What code should I write in order to make an exact replace
of a chart I have but paste it as a picture in order for
me to change the series of the original chart whithout
changing the new
Many thanks
Pedro
 
The only way I can find to do it, is to paste it into a
Word document and copy it back. Very long-winded, but it
works:

Dim Word As Object

' Copy the chart
ActiveChart.ChartArea.Copy
' Open a hidden instance of Word
Set Word = CreateObject("Word.Application")
' Add a blank document and paste in the chart
Word.Documents.Add DocumentType:=wdNewBlankDocument
Word.Selection.Paste
' Select and copy the chart in Word
Word.Selection.WholeStory
Word.Selection.Copy
' Close Word
Word.activedocument.Close 0
Word.Application.Quit
Set Word = Nothing
' Paste it into Excel
ActiveSheet.Paste

Hope this helps
Helen
 
Back
Top