Cicode Programming Reference > Cicode Function Categories > Dynamic Data Exchange Functions Introduction > DDERead

DDERead

Reads values from an external DDE compliant Windows application running on the same computer, (for example, from an Excel spreadsheet cell or a Word document).

This is a one-way static communication which is read once from the application per call. To read the value dynamically, call this function at the rate at which the data is required to be updated.

Use this function when you want precise control over exactly what you want from the DDE exchange.

Syntax

DDERead(sApplication, sDocument, sItem [, Mode] )

sApplication:

The application name (.EXE filename), for example, "WinWord".

sDocument:

The document, topic, or file name.

sItem:

A unique name for the item; for example, the variable name, field name, or spreadsheet cell position.

Mode:

A flag that tells the application whether or not to set up an advise loop:

0 - Do not set up advise loop.

1 - Set up advise loop (default).

Return Value

The value (from the external application) as a string, or an empty string if the function cannot read the desired values.

Related Functions

DDEExec, DDEPost, DDEWrite

Example

/* Read the value from R1C1 (Row1,Column1) of an Excel spreadsheet 
named "Sheet1". */
DDERead("Excel","Sheet1","R1C1");
/* Read the value from the Item1 bookmark of the Word document named "Recipes.doc". */
DDERead("Winword","Recipes","Item1");

See Also

DDE Functions