Opening Excel spreadsheet from Word

G

Garry

All,
Previously I have written a macro that opens an excel
spreadsheet from a Word document. The following code was
used.

Set xlDiagnostic = GetObject("c:\run\EVAL.xls")
xlDiagnostic.Application.Visible = True
xlDiagnostic.Parent.Windows(1).Visible = True

I wrote code to copy a graph into the Word document. All
was well.

Now I want to open a different spreadsheet from Word and
put data into various cells. When I use the same code the
EVAL worksheet does't open. Insteal, the Personal.xls
worksheet open. I should mention that the second macro is
being written on a different computer but the versions of
Word and Excel are the same. I copied the code for the
error checking for open spreadsheets etc from the first
macro into the second macro so all that code is the same.

Can someone suggest a solution?
 
Top