Code to copy chart

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
 
H

Helen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top