Board index » delphi » DDE commands that Excel makes visible to a DDE Client

DDE commands that Excel makes visible to a DDE Client

Hi everyone,

Does anyone know where the documentation is that specifies all the
commands that can be sent to Excel via a DDE conversation?

for example I can send the following code (DELPHI) to the program
manager in Windows 3.x to create a new program group :

        DDEClientConv.ExecuteMacro('[CreateGroup(Phony Group)]',true)

but I need to find a list of the commands I can send to Excel.

TIA.

Phil

--
/----------------------------------------------------------------\
| Phillip Middlemiss            | 2 wrongs don't make a right... |
| NZ Forest Research Institute  |                                |
| phill...@tawa.fri.cri.nz      |   .....but three lefts do      |
\----------------------------------------------------------------/

 

Re:DDE commands that Excel makes visible to a DDE Client


Quote
Phillip Middlemiss <phill...@fri.cri.nz> wrote:
>Hi everyone,
>Does anyone know where the documentation is that specifies all the
>commands that can be sent to Excel via a DDE conversation?
>for example I can send the following code (DELPHI) to the program
>manager in Windows 3.x to create a new program group :
>        DDEClientConv.ExecuteMacro('[CreateGroup(Phony Group)]',true)
>but I need to find a list of the commands I can send to Excel.
>TIA.
>Phil
>--
>/----------------------------------------------------------------\
>| Phillip Middlemiss            | 2 wrongs don't make a right... |
>| NZ Forest Research Institute  |                                |
>| phill...@tawa.fri.cri.nz      |   .....but three lefts do      |
>\----------------------------------------------------------------/

Phil,
The easiest way to go is to use the Excel macro recorder to see the
syntax and format of commands. Then translate them to Delphi as
follows (this is a cut'n'paste from a previous post of mine)

What I did was to record a macro in Excel as a 4.5 macro (not as
Visual Basic - see options button on "Record New Macro") then copy the
resulting macro into my Delphi project and put each commad in [...]
(square brackets) e.g.,

{Excel macro}
Macro1
=WORKBOOK.SELECT("Sheet1","Sheet1")
=SELECT("R6C1")
=FORMAT.NUMBER("0.00%")
=RETURN()

{resulting Delphi DDE}
{in my editor the next line is all one line until the ";" }
DdeClientConv1.ExecuteMacro('[WORKBOOK.SELECT("Sheet1","Sheet1")][SELECT("R6C1")]',false);
DdeClientConv1.ExecuteMacro('[FORMAT.NUMBER("0.00%")]',false);

note: you can combine commands in the same ExecuteMacro call (1st
line). Leave out the "=" and the "RETURN()".

Other Threads