Auto-create chart objects

B

Bill Sturdevant

I have an excel spreadsheet with 600 rows in it. Each row has the name of an
item followed by several columns of numbers.

I need to create 3 different small charts in a Word document for each row in
the spreadsheet. In word, you will see a Item Name, with 3 small, but
different charts on the next line, followed by a blank line.

I know I can create the charts in Excel using a macro and then copy and
paste them into word as pictures. Once that is done, I can tell word to run
a macro to format the pictures. But the quality of the text breaks down
depending upon how much I stretch the charts.

WHAT I WOULD RATHER DO is, either from Excel, tell word to insert Excel
chart objects or from Word, get the data from Excel and create the chart
objects.

Using the first method, I have created a macro in Excel to tell Word to run
a macro to put in a line of text with the item name in it, followed by a
paragraph break, followed by inserting an Excel object. But where do I put
the macro that tells the Excel object how to format itself? I do not want to
store the macro in each Excel object as that would bloat the document. I
have tried to place the Macro back in the original Excel sheet, but when I
tell it to run, it seems to want to run within the original Excel sheet, not
within the Excel object in Word.

What am I doing wrong? Or am I missing something even simpler that would
solve my problem?
 
W

Word Heretic

G'day Bill Sturdevant <[email protected]>,

From inside your word app you can define an Excel object. Check the
Tasks collection for an instance running, and re-use it or start a new
instance of Excel. Thus

MyApp.SomeExcelFunction blah blah

This way you can keep the excel code within your word app.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Bill Sturdevant reckoned:
 

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