571 DDE: Specified DDE server is not responding.

Problem: Getting error "DDE: Specified DDE server is not responding."

When opening a DDE session using ObjectPAL.
By: Bertil Isberg
Date: 5 sep 2005

If you specify the Topic and Item when opening a DDE server, you may get this error. As an example
ddeLink.open("EXCEL", "C:\\DATA\MyExcelFile.xls", "R1C1")
will cause the error.

To open a DDE link to Excel, you have to open the Excel file, eg by using shellExecuteA() from SHELL32.DLL and then apply the following code
var
 stService, stTopic, stItem String
 DDElink   DDE
 lgGoodlink  Logical
 atDdeinfo   AnyType
endvar
stService = "EXCEL"
stTopic = ""

lgGoodlink = DDElink.open(stService, stTopic)
; Note No topic and no Item
sleep(1000) ; don't know if necessary
if not lgGoodlink then
 if not DDElink.open(stService, stTopic) then
  errorShow()
  return
 endif
endif
try
   ddelink.setItem("R1C1")
   atDdeinfo = DDElink
   msginfo("DDE Item", atDdeinfo)
onfail
   errorshow()
endtry
DDElink.close()

To index