Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: DDE commands command format help wbt
WinBatch is a client. It must initiate the connection and transaction. The DDE commands that applications respond to are documented by the individual applications; WinBatch just sends those commands.
The DDEInitiate broadcasts a plea for help and talks with the first one that responds.
Here is some sample code that drives Excel.
You cannot run this as is, but it may give you some idea of what the code looks like.
pokechan=DDEInitiate("Excel",SheetName) DDEPoke(pokechan,"R1C1","Symbol") DDEPoke(pokechan,"R1C2","Company") DDEPoke(pokechan,"R1C3","Date") DDEPoke(pokechan,"R1C4","Hi/Ask") DDEPoke(pokechan,"R1C5","Low/Bid") DDEPoke(pokechan,"R1C6","Last") DDEPoke(pokechan,"R1C7","Change") DDEPoke(pokechan,"R1C8","Volume") DDEPoke(pokechan,"R1C9","Delta->") DDEPoke(pokechan,"R1C10","=$F31-$F30") DDETerminate(pokechan) DDEExecute(channel,`[SAVE.AS("%SheetName%")]`) If FileExist(ChartName) then FileDelete(ChartName) DDEExecute(channel,`[NEW(2)]`) DDEExecute(channel,`[GALLERY.LINE(8)]`) DDEExecute(channel,`[ATTACH.TEXT(1)]`) Title="%TheQuote% Month of %MonthText%" DDEExecute(channel,`[FORMULA("%Title%")]`) DDEExecute(channel,`[SAVE.AS("%ChartName%")]`) DDEExecute(channel,`[SELECT.CHART]`) DDEExecute(channel,`[WINDOW.SIZE(310,255)]`) DDEExecute(channel,`[COPY.PICTURE(1,1,2)]`) DDEExecute(channel,`[CLOSE(FALSE)]`) DDEExecute(channel,`[CLOSE(TRUE)]`)
cellval = DDERequest (channelID, "RxCy")where channelID is the DDE channel ID to the open Excel worksheet and x and y are the row and column numbers respectively. Alternatively, you can say
cellval = DDERequest (channelID, "name")where name is a defined name of a cell range of the open worksheet.
Article ID: W12815
Filename: How are the DDE commands used - Excel example.txt
File Created: 1999:04:15:16:49:50
Last Updated: 1999:04:15:16:49:50