From the "Script Library" window: DDE_getdata ( channel number ) return string DDE_open ( ) return number Implementations: DDE_getdata: ----------- Dim buffer, string DDEGetData channel, "R1C1", buffer Return buffer DDE_open: -------- Dim channel, number DDEOpen "Excel", "test.xls", channel Return channel Test script: ----------- Dim channel, number Dim buffer, string //DDEOpen "Excel", "test.xls", channel DDE_open channel //DDEGetData channel, "R1C1", buffer DDE_getdata channel, buffer MessageBox buffer DDEClose channel ---------- Really simple...but doesn't work: Line 8: Line 4: Request R1C1 failed. DDE error: Invalid parameter passed to DDE function. The strange is that if You check the correctness of the channel number with a message box in the two user functions You see the same number... : I think the problem is not in DDE but in the way you defined DDE_getdata : and/or your other DDE statements : For the sake of argument if you define buffer as a number and channel as : string you may get various type conversion errors and making the script : unusable. Please check you statement definitions and that you pass : variables correctly. : If possible post your entire script.
|