DDE Initiate does not work

F

Ferenc Nagy

Hi!
This is an Excel Macro.
I want to pass data from Excel to another program,
running in a command window.

Sub Macro2()

Dim channelNumber As Long
Application.DisplayAlerts = False

channelNumber = Application.DDEInitiate("PE2", "new.txt")
Set rangeToPoke = Worksheets("Sheet1").Range("A1:C2")
Application.DDEExecute channelNumber, "e x"
Application.DDEExecute channelNumber, "[cursor data]"
Application.DDEPoke channelNumber, "[cursor data]",

rangeToPoke
Application.DDEExecute channelNumber, "[mark line]"
returnList = Application.DDERequest(channelNumber,

"Topics")
For i = LBound(returnList) To UBound(returnList)
Worksheets("Sheet1").Cells(i, 1).Formula =

returnList(i)
Next i
Application.DDETerminate channelNumber

End Sub

The Pe2 program has started but
why have I got Run time error 13 "type mismatch" at this
line:
channelNumber = Application.DDEInitiate("PE2", "new.txt

What can I do instead of DDE calls?
Regards
Ferenc Nagy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top