Documentation/How Tos/Calc: DDE function

From Apache OpenOffice Wiki
< Documentation‎ | How Tos
Revision as of 20:40, 14 May 2008 by Drking (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


DDE

Returns data from a DDE-based link.

Syntax:

DDE(server; file; item; mode)

server is the (text) name of a server; for example "soffice" for OpenOffice.org.
file is the (text) complete name or IRL (Internet Resource Locator) of the document containing the data; for example "c:\office\document\test1.ods" or "file:///documents/test2.ods".
item is the (text) name of the item to return. For example "Sheet1.B3" is cell B3 on Sheet1 of a Calc spreadsheet; "MySection" is the first line of a section named "MySection" in a Writer document.
mode is an optional parameter specifying how numbers are returned. Non-numeric text is returned unchanged.
0 or omitted: Data is converted to number if possible, using the default cell style
1: Data is converted to number if possible, in US English (en_US) format (for example with “.” as the decimal separator)
2: Data is always retrieved as text (not converted to number).
DDE creates a link to (and returns the contents of) item, so any change to item is mirrored by the DDE result.
An alternative method to create a DDE link is to copy the cell or range from the source file to the clipboard, then use the menu command Edit - Paste Special, selecting the 'Link' option. The link is inserted as a DDE function, as an array formula.
The menu command Edit - Links... lists DDE links, and allows them to be modified (for example to choose manual or automatic updating), manually updated or broken.

Examples:

=DDE("soffice";"C:\OpenOffice\test1.ods";"Sheet1.C7")

creates a link to and returns the contents of cell C7 on Sheet1 of the Calc file test1.ods.

=DDE("soffice";"C:\OpenOffice\test2.odt";"Table1")

when entered as an array formula, creates a link to and returns the contents of the table named Table1 in the Writer file test2.odt, in a single column. Each line in a table cell appears in its own cell. The contents of the top left table cell appear first, followed in order by other cells on the top row, and followed similarly by other rows in order. The INDEX function can be used to return just part of the table.

=DDE("soffice";"C:\OpenOffice\test2.odt";"Section1")

when entered as an array formula, creates a link to and returns the contents of the section named Section1 in the Writer file test2.odt, in a single column, one line per cell. When entered normally (not as an array formula) this returns the top line of Section1.

See also:

INDEX

Spreadsheet functions

Issues:

  • Excel does not have this function.
Personal tools