Can i run a WORD VBA macro from a .bat file?

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

Guest

Hello can i run a WORD VBA macro from at .bat file somehow?

The reason i need to do this is because i need to process about 500+ WORD
documents and when i process over 50 at a time i get "Hyperlink invalid
errors....", but when i run the macro for groups of 50 at a time it processes
them ok!

So if i could create a .bat file to call this WORD VBA macro 10 or so times,
and pass in an incrementer value, that would save alot of manual effort and
plus i need to do this process at least twice a month!

Thanks very much for any pointers or suggestions!
BobK
 
bobk,

You can run a Word macro using vbScript. You can then use the vbScript file
as an intermediary and use your batch file to run wscript.exe or cscript.exe
presenting the full name of the vbs file as an argument. However, you're
probably better off doing the whole thing from the vbs file.

Does your macro reside in a single document and you're processing the other
documents using this macro or are you processing a batch of documents, each
containing the macro you want run?

Steve
 
Hi Steve!

YES this way >>> The macro resides in a single document and am processing
the other documents using this macro

Thanks alot Steve, didn't know about vbs, going to look into this approach!

Have a great week Steve!
BobK
 

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