Excecute a word doc. & the macro with in it.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I have a xl macro run a word document? and when the word doc. is closed have it refresh it self
 
From Excel:

Set a reference to the Word object library

Dim wdApp as Word.Application
Dim wdDoc as Word.Document

Set wdApp = New Word.Application
Set wd.Doc = wdApp.Documents.Open("C:\My Path\Mydoc.doc")
'additional code goes here
wdDoc.Save
wdApp.Quit True ' save any changes to the Word document
Set wdDoc = Nothing
Set wdApp = Nothing
 

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

Back
Top