Discussion:
link
(too old to reply)
a***@discussions.microsoft.com
2004-09-07 21:35:12 UTC
Permalink
Using a WORD Macro:
What would be the best way to open an excel file, then set
a range based on what is in the excel file, then copy the
information into a word document. I do not want to set the
range as a fixed link because the range in the Excel file
will change.

Thank You
Jezebel
2004-09-07 21:49:54 UTC
Permalink
Exactly as you describe is a reasonable way to do it: open it, select the
range, copy. There's even an example in the VBA Help file.
Post by a***@discussions.microsoft.com
What would be the best way to open an excel file, then set
a range based on what is in the excel file, then copy the
information into a word document. I do not want to set the
range as a fixed link because the range in the Excel file
will change.
Thank You
a***@discussions.microsoft.com
2004-09-08 19:22:37 UTC
Permalink
Thank You for your suggestions.

I am sorry, I am new to Word Macros and still am having
trouble finding your help suggestion. To clarify the
problem with the first response is: I would like to
prevent having to rename range the sections manually,
because there are several sections of the Excel
spreadsheet that will be pasted into various areas of the
Word document. I am familiar with moving around Excel with
VBA, but not within Word. I cannot determine how to open
an Excel application or file from Word VBA.
-----Original Message-----
open it, select the
range, copy. There's even an example in the VBA Help file.
Post by a***@discussions.microsoft.com
What would be the best way to open an excel file, then
set
Post by a***@discussions.microsoft.com
a range based on what is in the excel file, then copy
the
Post by a***@discussions.microsoft.com
information into a word document. I do not want to set
the
Post by a***@discussions.microsoft.com
range as a fixed link because the range in the Excel
file
Post by a***@discussions.microsoft.com
will change.
Thank You
.
Jezebel
2004-09-08 21:15:46 UTC
Permalink
I cannot determine how to open
Post by a***@discussions.microsoft.com
an Excel application or file from Word VBA.
Easier for you to read about this in Help than for me to copy the help topic
to this message. Believe me, there's sample code and everything.

macropod
2004-09-08 11:44:47 UTC
Permalink
Hi,

Why not name the range in Excel, then use a LINK field referring to the
named range? For example:
{LINK Excel "C:\\My Documents\\My File.xls" "NamedRange" \a \p}

To have Word respond to changes in the number of rows/columns referred to,
simply redefine the named range in Excel.

Also, if you want to use a different format, just change the \p switch (eg
\b = bitmap, \r = rtf, \t = text).

No macros required!

Cheers
Post by a***@discussions.microsoft.com
What would be the best way to open an excel file, then set
a range based on what is in the excel file, then copy the
information into a word document. I do not want to set the
range as a fixed link because the range in the Excel file
will change.
Thank You
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.736 / Virus Database: 490 - Release Date: 9/08/2004
Loading...