Difference between revisions of "Documentation/How Tos/Calc: DDE function"
From Apache OpenOffice Wiki
< Documentation | How Tos
(→See also:) |
m |
||
(9 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | __NOTOC__ | + | {{DISPLAYTITLE:DDE function}} |
+ | {{Documentation/CalcFunc SpreadsheetTOC | ||
+ | |ShowPrevNext=block | ||
+ | |PrevPage=Documentation/How_Tos/Calc:_SHEETS_function | ||
+ | |NextPage=Documentation/How_Tos/Calc:_HYPERLINK_function | ||
+ | }}__NOTOC__ | ||
== DDE == | == DDE == | ||
Line 7: | Line 12: | ||
<tt>'''DDE(server; file; item; mode)'''</tt> | <tt>'''DDE(server; file; item; mode)'''</tt> | ||
− | : <tt>'''server'''</tt> is the (text) name of a server; for example <tt>'''"soffice"'''</tt> for | + | : <tt>'''server'''</tt> is the (text) name of a server; for example <tt>'''"soffice"'''</tt> for {{AOo}}. |
− | : <tt>'''file'''</tt> is the (text) complete name or | + | : <tt>'''file'''</tt> is the (text) complete name or URL (Uniform Resource Locator) of the document containing the data; for example <tt>'''"c:\office\document\test1.ods"'''</tt> or <tt>'''"file:///documents/test2.ods"'''</tt>. |
: <tt>'''item'''</tt> is the (text) name of the item to return. For example <tt>'''"Sheet1.B3"'''</tt> is cell <tt>'''B3'''</tt> on <tt>'''Sheet1'''</tt> of a Calc spreadsheet; <tt>'''"MyRange"'''</tt> is the name of a range in a Calc spreadsheet; <tt>'''"MyItem"'''</tt> is the name of a section or table in a Writer document. | : <tt>'''item'''</tt> is the (text) name of the item to return. For example <tt>'''"Sheet1.B3"'''</tt> is cell <tt>'''B3'''</tt> on <tt>'''Sheet1'''</tt> of a Calc spreadsheet; <tt>'''"MyRange"'''</tt> is the name of a range in a Calc spreadsheet; <tt>'''"MyItem"'''</tt> is the name of a section or table in a Writer document. | ||
: <tt>'''mode'''</tt> is an optional parameter specifying how numbers are returned. Non-numeric text is returned unchanged. | : <tt>'''mode'''</tt> 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, | + | :: 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) | :: 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). | :: 2: Data is always retrieved as text (not converted to number). | ||
Line 20: | Line 25: | ||
: <tt>'''DDE'''</tt> creates a link to (and returns the contents of) <tt>'''item'''</tt>, so any change to <tt>'''item'''</tt> is mirrored by the <tt>'''DDE'''</tt> result. | : <tt>'''DDE'''</tt> creates a link to (and returns the contents of) <tt>'''item'''</tt>, so any change to <tt>'''item'''</tt> is mirrored by the <tt>'''DDE'''</tt> result. | ||
− | : An alternative method to create a <tt>'''DDE'''</tt> link is to copy the cell or range from the source file to the clipboard, then use the menu command | + | : An alternative method to create a <tt>'''DDE'''</tt> link is to copy the cell or range from the source file to the clipboard, then use the menu command {{menu|Edit|Paste Special}}, selecting the 'Link' option. The link is inserted as a <tt>'''DDE'''</tt> function, as an array formula. |
− | : The menu command | + | : The menu command {{menu|Edit|Links…}} lists DDE links, and allows them to be modified, manually updated or broken. |
Line 39: | Line 44: | ||
<tt>'''=INDEX(DDE("soffice";"C:\OpenOffice\test2.odt";"Section1");2)'''</tt> | <tt>'''=INDEX(DDE("soffice";"C:\OpenOffice\test2.odt";"Section1");2)'''</tt> | ||
: when entered as an array formula, creates a link to and returns the contents of the second paragraph of <tt>'''Section1'''</tt> in the Writer file test2.odt. | : when entered as an array formula, creates a link to and returns the contents of the second paragraph of <tt>'''Section1'''</tt> in the Writer file test2.odt. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Issues: === | === Issues: === | ||
* Excel does not have this function. | * Excel does not have this function. | ||
* When using an array to return data, the size of the array is fixed on first calculation. If for example the number of lines in a Writer table or section changes, the array size in Calc does not change. | * When using an array to return data, the size of the array is fixed on first calculation. If for example the number of lines in a Writer table or section changes, the array size in Calc does not change. | ||
+ | * On the majority of platforms, accented characters are treated wrong. | ||
* There are alternative ways to link to external data. | * There are alternative ways to link to external data. | ||
+ | |||
+ | {{SeeAlso|EN| | ||
+ | * [[Documentation/How_Tos/Calc: INDEX function|INDEX]] | ||
+ | |||
+ | * [[Documentation/How_Tos/Calc: Spreadsheet functions|Spreadsheet functions]] | ||
+ | |||
+ | * [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]] | ||
+ | * [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}} | ||
+ | [[Category: Documentation/Reference/Calc/Spreadsheet functions]] |