Difference between revisions of "SETCALCCELLS"

From iMath
Jump to: navigation, search
 
Line 28: Line 28:
 
2.2.0 or earlier.
 
2.2.0 or earlier.
  
Up to version 2.2.6 only literal strings are allowed, not string expressions
+
Up to version 2.2.6 only literal strings are allowed for file name, table name and cell reference, not string expressions
 
}}
 
}}
 
[[Category:Data exchange]]
 
[[Category:Data exchange]]

Latest revision as of 13:49, 1 September 2018

Syntax

SETCALCCELLS { expression , expression , expression , expression }

Implemented in iMath since version 2.2.0 or earlier.

Up to version 2.2.6 only literal strings are allowed for file name, table name and cell reference, not string expressions.

Explanation

Set the value of a cell range in an Office Calc document. The first string expression contains the file name of the Calc document (relative paths are possible). The second string expression contains the sheet name, and the third the cell range reference. The dimensions of the cell range must match the dimensions of the expression (scalar, vector or matrix).

The Calc document is saved immediately after the change, during the recalculation of the iMath document.

Example

The following example will increment the value in cell A1 of table Tabelle1 in file Unbenannt 1 at each iMath recalculation run.

EQDEF cell = "a1"

EQDEF z = CALCCELL("Tabelle1", VAL(cell))

SETCALCCELL {"Unbenannt 1.ods", "Tabelle1", VAL(cell), VAL(z+1)}

Note that VAL is required here to create a string expression from the variable.

See also

CALCCELL SETTABLECELL TABLECELL