DDE - Dynamic Data Exchange

Ken Ray kray at sonsothunder.com
Sat Nov 16 18:47:01 EST 2002


> Does anyone have examples of how I can execute VBA code via DDE from
> Revolution?

Well, here's how you communicate via VBA from something like Excel to
Revolution once it has been registered as "EXT" by the Externals Collection:

Private Sub CommandButton1_Click()
  Dim tVal as Long
  tVal = Application.DDEInitiate("EXT","myTopic")
  Application.DDEExecute tVal, "myCommand")
End Sub

In the Externals collection, there are two parameters that are passed to the
"extDDEexecuteMsg" handler - a "topic" and a "command". Here's how it looks
trapping it in Rev:

on extDDEexecuteMsg pTopic, pCommand
  switch pTopic
    case "myTopic"
      answer "Command is: " & pCommand
      break
    case "otherTopic"
      -- do something else
      break
  end switch
end exteDDEexecuteMsg

Hope this helps,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/




More information about the use-livecode mailing list