Automation: Excel bid sheet => Word contract for customer

D

David F

We have created an elaborate estimating sheet in Excel and would like to
use automation to create a printed contract for the customer to sign.
How to do the automation has me a little puzzled, so I'm asking for some
general guidelines. Here's my general approach.

1) Excel sheet produces all estimating values
2) Click custom toolbar button to start Word and make a document based
on a template.
3) The template has custom styles, autotext, and graphics already
defined.
4) A form will be provided for the user to make certain choices. These
insert different autotext entries, etc.
5) The user will likely edit the document before printing it.

QUESTION
Which ap should do the automation controlling--Excel or Word?
I preferred for Word to read the data from the workbook, but cannot
figure out how to make a reference to an instance of an Excel workbook
that is already running. (GetObject seems to want to open an ap and its
file from disk.) Is there a way? A few code snippets would be great!
Thanks in advance.

(Of course Excel could do the automation, but I anticipate many more
changes in the Word template. Thus it seems more reasonable for Word to
do the automation.)

David F.
 
D

David F

After sleeping on it...

1. Use CreateObject() to make the Word doc.
2. Put the workbook path and name into the doc.
3. Close the workbook.
4. Use GetObject() to reopen the workbook. Now Word is in control.
5. Now we have a reference to the workbook.

Seems a roundabout way, but should do the job.

David F.
 

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