Advanced DDE
The simple answer would be that the built in DDE controls aren't very good
(from what I've read, I've only ever tried to use them, with little
success). Other DDE controls are available with improved functionality - use
the mighty Google.
Jeff
"Jeff Harbin" wrote in message
...
I've got an Excel workbook that is successfully receiving data from
another
software application. I'm using the data received to perform a couple of
specific calculations and then I want to pass the result back to the
original
program for display.
I'm using a series of DDE links ... =Citect|Variable!Average ...
From the documentation provided with Excel it sounds like I want to use
the
DDEPoke command and this is the code that I've developed...
///Start Code////
Dim sngAWU as Single, iChannel as Long
sngAWU = 32.456
lngChannel = Application.DDEInitiate("CiTech", "Variable")
Application.DDEPoke lngChannel, AWU, sngAWU
Application.DDETerminate lngChannel
///End Code////
As I understand this code, it should establish a DDE link with application
(Citect) and Topic (Variable), send the specified information (sngAWU) to
the
desired placeholder (AWU), and then terminate the link. I'm getting
nothing.
If I follow the example exactly as in Excel help using the following line
Set rangeToPoke = Worksheets("Sheet1").Range("A1")
and substituting sngAWU in the above line with rangeToPoke, Excel crashes.
|