Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

From Excel Chart to Word Graphic 2

Status
Not open for further replies.

muki

Programmer
Nov 25, 2002
4
0
0
ES
Hi folks,

I am trying to export an excel chart into a word document without success so far.

I tried with OLE, and i saw the chart in word, but when i saved the document i got a kind of 500 pages binary file.

I also tried de copy paste, but i got a type error.

Finally i have been trying to save the chart as an image file, but i havent been able to export it to an image file.

i have been looking on the internet, but no success either.

Which is the best way?
Or just any possible way.

Thanks in advance,

Muki.
 
I use the following command in Word VBA to insert an Excel chart on the clipboard:

Selection.PasteSpecial Link:=False, DataType:=wdPasteMetafilePicture, _
Placement:=wdInLine, DisplayAsIcon:=False

For some reason, this only works when the copy operation was performed on an Excel chart sheet, not on a chart embedded in a worksheet. But it's easy enough to switch between the two, even programmatically.
You may want to change the Placement parameter to something other than wdInLine, depending on your document's formatting.
Rob
[flowerface]
 
Thanks a lot,

I´ll try this.
i guess my problem was that the chart is embedded.

Muki.
 
I perforrmed the copy operation on a chart embedded in a worksheet, and it works great.

*****.copypicture

Thats all.
 
Hey muki, Ive been having the same problem as you. I have an Access form that im trying to get to loop through excel and grab the graph and paste it into word. Could you help me with what you have so far.
 
Hi Muki,
What a wonderful find! Excel VBA is full of surprises. This will allow me to streamline some of my pre-existing macros. Digging a little further, I found that this functionality is also available from the Excel user interface, by hitting Shift and clicking the Edit menu - this makes the Copy Picture command available.
Rob
[flowerface]
 
Hi Alrandal,

i think it´s all said. copy the chart with copypicture and paste it with pastespecial.

let me know if you´ve got any other question.

Muki.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top