How to run Word macro in Excel macro

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

I am trying to run a Word macro in Excel macro. Could
someone show me an sample?
Thanks
Kevin
 
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 (e-mail address removed)
 
Back
Top