View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Steve Yandl Steve Yandl is offline
external usenet poster
 
Posts: 284
Default Run a Word Macro from Excel VBA

Daniel,

Here is an example. In this case, my macro was stored in a template but you
can run a macro from a document file as well. As an alternate approach, you
can create a reference to the word application and have the same tools
available from your VBA routine within Excel which would have the advantage
of not being tied to some Word document or template.

Set objWdApp = CreateObject("Word.Application")
objWdApp.Documents.Add("C:\Test\myVBA.dot")
objWdApp.Run "myMacroA"


Steve Yandl



"Daniel" wrote in message
...
How can I Run a macro recorded in word in excel VBA.

Note: the word macro performs a function on a text file that I cant
perform
from excel VBA, which is to get a .txt file and make some replacements and
save it.

thanks