mwildman Newbie

Joined: 06 Aug 2010 Posts: 1
|
Posted: Fri Aug 06, 2010 10:31 am Post subject: DDE Application Name, Topic and Command for Open Office |
|
|
I'm using an external program (WinWedge) and want to issue a DDE command that runs a macro in my open office document.
To establish a DDE Link and send a command in WinWedge, I need to know these three items for open office:
DDE Application Name
DDE Topic
DDE Command
From what I've read on the wiki and support forums, DDE functionality is limited. But I have so far been able to use DDEInitiate, DDERequest, and DDETerminate in star basic to successful grab data from WinWedge, so I'm hoping there is some way to flip the scenario and make a request to open office to run a macro.
Here's my working code in open office
| Code: | Sub GetSWData()
Dim R As Long
Dim NumFields As Long
Dim Chan As Long
Dim Sheet
Dim data As String
R = 0
NumFields = 2
Chan = DDEInitiate("WinWedge", "Com1")
Sheet = thisComponent.Sheets("Sheet1")
'DATE AND TIME
Cell = Sheet.getCellByPosition(0, R)
Cell.Value = Now
For X = 1 To NumFields
data = DDERequest(Chan, "Field(" & Cstr(X) & ")")
Cell = Sheet.getCellByPosition(X, R)
Cell.Value = data
Next
DDETerminate (Chan)
End Sub |
Any help or advice is appreciated! |
|