Using a macro to get external data

B

Bruce

I just recorded a Word macro that is supposed to open
Exel, open a workbook, copy a small range of cells, then
paste the range into the Word document. The macro runs
fine as long as Excel and the workbook are open. If I run
the macro with Excel and the workbook closed, the macro
returns a runtime error. Am I attempting something that a
Word macro cannot do?
 
J

Jay Freedman

Hi, Bruce,

A Word macro can start Excel if it isn't running, but it isn't
something you can record -- you'll have to edit the macro to add some
extra logic. See the code at
http://word.mvps.org/FAQs/InterDev/ControlXLFromWord.htm.

If you can't figure out how to adapt it to your needs, please post in
microsoft.public.word.vba.beginners instead of this newsgroup. Include
whatever code you have already, and describe exactly what it does or
doesn't do, including the exact text of any error messages.
 
Top