Carolyn: When you say a "Word template", and you say the Excel "spreadsheet
is generated from a template", I get the idea that this is a
boiler-plate-type report you run on a regular basis. A template in Word is
just that - a preformatted "master" that has some elements in it, and
"blanks for you to fill in. It's invoked by choosing File >> New. You
could add another template there that has all the standard language of your
report, a bookmark for where your Excel info lands, and a macro that
automatically runs when a new document is created from that template.
If the spreadsheet is generated from a template, is it always saved in the
same location? And is it always saved with a similar name, perhaps made
unique by adding the date to the name? (As in "C:\Desktop\MyData\ThisData
20060209.xls") If so, then a macro can be coded to automatically search
that folder directory for the latest file of type .xls, open it and copy the
data from a certain range, and then exit and paste that into your report
doc.
A different way, especially if your Excel file is not all that consistent,
but your Word doc would be, is to open the Excel file and run an Excel macro
to copy the data, open a Word doc and paste, and then save the Word doc.
The advantage this might have is you are definitely in the right Excel file
to get the current data. This can still be done from within Word, but you
would have to open a dialog to browse for the file - that's not a bad thing;
it's just one more step. It really all depends on how much is consistent
and how much is sparkling new each time.
Ed
Stoke said:
Thank you John, Cindy and Ed - To give you the info that is needed - The name
of the spreadsheet will vary. This comlicates things to be sure. But the
spreadsheet is generated from a template, so it should be of a consistent
format.
Your ideas all seem to be heading toward what I think I need - I will need
some guidance in how to implement these solutions, since I am now in new
territory! Thank you so much. Carolyn
John McGhie [MVP - Word and Word Macinto said:
This is easy if the name of the Excel spreadsheet does NOT vary: you simply
link to named ranges in the spreadsheet, as described in the Help.
If the name of the spreadsheet DOES vary, you need to construct logic to
compute the name of the spreadsheet and perform the import.
We can be more help if you provide more detail about what you're trying to
accomplish.
On 3/2/06 10:41 PM, in article
(e-mail address removed), "Stoke"
How can I create a Wrod template that will pull data from an Excel
spreadsheet - even copying the column would be good enough. It would have to
be a template that allows us to specify the name of the Excel spreadsheet,
since that will be what varies. Thanks! Carolyn
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.
John McGhie <
[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410