cryptorchid Posted August 5, 2009 Report Share Posted August 5, 2009 This is very similar question to question 31 in the knowledge base. I am hoping that some one has come up with a better solution in 9 years. I want to launch a macro express macro from excel, VBA. I first thought it would be simple by launching via the commandline and pass along some variables, but have not figured out how to launch dos command from excel. Excel does have the capability to send DDE commands via vba and wondered I can do something similar with Macro Express. Here is an example code of DDE Execute from Excel to Word channelNumber = Application.DDEInitiate( _ app:="WinWord", _ topic:="C:\WINWORD\FORMLETR.DOC") Application.DDEExecute channelNumber, "[FILEPRINT]" Application.DDETerminate channelNumber I would also need to pass along some variables. Any clue how I can launch a Macro Express macro from Excel? Thanks CryptOrchid Quote Link to comment Share on other sites More sharing options...
cryptorchid Posted August 5, 2009 Author Report Share Posted August 5, 2009 Looks like I found my own solution on another website. There is a command to execute a dos command called shell(). I found the solution here: Forum post on using shell command Quote Link to comment Share on other sites More sharing options...
paul Posted August 6, 2009 Report Share Posted August 6, 2009 In launching a macro from Excel, you need to consider whether or not you want to wait until the macro has finished before continuing in Excel. If you need to d0 this often - i.e. several times a minute - then there's a better way of launching your macro. If you do this only infrequently then Shell (or its wait variation) is OK. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.