Macros with charts

J

justin

I have pasted a chart from an Excel worksheet into a new
Word document using Excel VBA. I am now using the Word
macro recorder to build up code to then incorporate in the
Excel code to enhance the docuemnt before saving it.

I notice that when recording I cannot select the chart in
order to centre in in the document. Is this how it should
work or am I doing anything wrong and is there a way to
get around the problem.

Thanks
 
C

Cindy M -WordMVP-

Hi Justin,

Mmmm. With Word, it depends on whether the chart is being
inserted as an InlineShape (like a text character) or as a
Shape (with textwrap formatting). In this case, probably as a
Shape, which makes things "yucky".

My preference is to insert a LINK field (which can then be
turned into plain text if you don't want a dynamic link) so
you can get a true handle on the object. Use Edit/Paste
Special, with a link. Format the chart object to be in-line
with the text. Press Alt+F9 to see the field codes (the
string you need for the Fields.Add Text argument).
I have pasted a chart from an Excel worksheet into a new
Word document using Excel VBA. I am now using the Word
macro recorder to build up code to then incorporate in the
Excel code to enhance the docuemnt before saving it.

I notice that when recording I cannot select the chart in
order to centre in in the document. Is this how it should
work or am I doing anything wrong and is there a way to
get around the problem.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 

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