Calling a macro (in Word document) from Excel macro using document name a runtime


Calling a macro (in Word document) from Excel macro using document name a runtime



I need help in triggering a sub in a word document from Excel VBA. I want to use the Word document name at run time while calling the macro from Word document.



I have done similar thing for PowerPoint and I want to replicate the same for word.



Code snippet used for PPT:


objPPT.Run "'" & StrPPTName & "'!ModuleName.Sub-Name", arg1, arg2



I am not able to do the same for Word, please suggest.





"I am not able to do the same for Word" why not? What did you try for Word and why didn't it work? What errors did you get?
– Pᴇʜ
Jun 29 at 6:46





In addition to what @Peh says: Is this MAC or WinWord and which version of Office? Use the edit link below the question to add information or make any changes. Don't try to answer in comments, please.
– Cindy Meister
2 days ago





Also, see this question which looks very similar to yours stackoverflow.com/questions/51067840/…
– Cindy Meister
2 days ago





Error: object doesn't support this property or method. Code below: Call objWORD.Run("'" & StrWORDName & "'!Module.SubName", myfilePath, myfile, j) objWORD is an object, StrWORDName is a docm file
– X-Guy
2 days ago





Possible duplicate of How to call Word macros from Excel
– PGCodeRider
2 days ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Export result set on Dbeaver to CSV

Opening a url is failing in Swift