How to run Word macro in Excel macro

K

Kevin

I am trying to run a Word macro in Excel macro. Could
someone show me an sample?
Thanks
Kevin
 
C

Chip Pearson

Kevin,

Try something like the following


Dim WD As Word.Application
Dim Doc As Word.Document
Set WD = New Word.Application
With WD
Set Doc = .Documents.Open("C:\doc1.doc")
.Run "Doc1!TheMacro"
Doc.Close savechanges:=False
.Quit
End With



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com [email protected]
 
Top