Help with DDEExecute

Hello,

I have created two excel workbooks called Server.xls and Client.xls. Client.xls has a button which when clicked executes the code below.

Private Sub cmdSendCommand_Click()

lChannelNum = DDEInitiate("Excel", "[Server.xls]Sheet1")
sRequeststr = "[New]"
DDEExecute lChannelNum, sRequeststr
DDETerminate lChannelNum

End Sub

When the button is clicked in Client.xls indeed a new blank workbook is opened in server.xls.

My question is how do I use DDEExecute to run my own macros defines in Server.xls Is this possible. I have tried the obvious which is to replace [New] with [MyMacro] but with no luck...Any insights would be appreciated.

Saleem



Answer this question

Help with DDEExecute

  • Bo Tanaka

    Got this to work as well. The trick is to use [Run("ThisWorkbook.MyMacro")] as the command.

    Saleem


  • Help with DDEExecute