Lupp, you say, “If there is a living formula in a cell … you can access that cell and ask it for the resulttype and for the .Value or the .String (probably better read from the .DataArray), and assign what you get to your program variable.” And I believe you.
In LibraOffice Help searching on .Value, .String and .DataArray did not result in anything I recognozed as useful. I also looked at the following four things.
- Using Calc Functions in Macros
com::sun::star Module Reference
- the module com::sun::star is the root module of the UNO API
- CreateUnoService Function
Instantiates a Uno service with the ProcessServiceManager
- FunctionAccess Service Referencepublished
allows generic access to all spreadsheet functions.
A Google search on .DataArray or DataArray yields at least two results.
- DataArray provides a wrapper around numpy ndarrays that uses labeled dimensions and coordinates to support metadata aware operations
- Xarray is a python library that lets us create N-dimensional arrays just like numpy but it let us name the dimension of the N-dimensional array as well.
At https://www.openoffice.org, “Your search - .DataArray site:https://www.openoffice.org - did not match any documents.”
However, a search on DataArray yields more than these four results
On the module sheet, we see these possible prospects.
module sheet: Spreadsheet specific interfaces.
AccessibleCell The accessible view of a spreadsheet document;
Cells represents a collection of used cells in a spreadsheet document;
FormulaParser , (Generic. converts between text and token representations of formulas ) (https://www.openoffice.org/api/docs/common/ref/com/sun/star/sheet/FormulaParser.html)
SheetCell represents a single addressable cell in a spreadsheet document.
Included Services - Summary
:com::sun::table::Cell provides basic cell handling and contributes common cell formatting properties
Exported Interfaces - Summary
::com::sun::document::XActionLockable provides methods to lock and unlock the update between ::com::sun::table::XCell and ::com::sun::text::XText.
::com::sun::text:XTextFieldsSupplier: provides access to the text fields used in this cell. (getTextFields )
string FormulaLocal [ OPTIONAL ] contains the formula string with localized function names. (https://www.openoffice.org/api/docs/common/ref/com/sun/star/sheet/SheetCell.html#FormulaLocal)
[ readonly ] long FormulaResultType contains the result type of a formula (VALUE, STRING, ERROR).
[ readonly ] string AbsoluteName [ OPTIONAL ] Returns the absolute adress of the range as string, e.g. “$Sheet1.$B$2”.
service SheetCell https://www.openoffice.org/api/docs/common/ref/com/sun/star/sheet/SheetCell.html
XArrayFormulaRange provides handling of array formulas in a cell range.
XArrayFormulaTokens gives access to an array formula as token sequence.
XCalculatable represents something that can recalculate.
XCellAddressable represents a cell which can be addressed with a ::com::sun::table::CellAddress Sheet, Column, Row
XCellRangeData allows to get and set an array of data from a cell range. getDataArray gets an array from the contents of the cell range. setDataArray fills the cell range with values from an array. (https://www.openoffice.org/api/docs/common/ref/com/sun/star/sheet/XCellRangeData.html) (uses of interface XCellRangeData: General. https://www.openoffice.org/api/docs/common/ref/com/sun/star/sheet/XCellRangeData-xref.html)
XCellRangeFormula allows to get and set cell contents (values, text or formulas) for a cell range.
XCellRangeReferrer allows direct access to the cells in a named range or to the cells which are visible in a view, without the need to get the document object first.
XCellRangesAccess provides access to the cells or to sub-ranges of all sheets.
XFormulaParser converts between text and token representations of formulas. parses a formula into tokens. converts a formula into a string.
XFormulaQuery provides methods to query cells for dependencies in formulas.
XFormulaTokens gives access to a formula as token sequence.
XSheetCellRange provides access to the spreadsheet that contains a cell range.
XSheetOperation provides methods to execute operations on a cell range or ranges.
XSolverDescription gives access to user-visible strings for a solver. Returns a short description for a bound, constrained, or free property.
XSpreadsheetDocument provides access to a collection of spreadsheets.
XSpreadsheetView is the main interface of a SpreadsheetView. It manages the active sheet within this view.
ComplexReference contains a reference to a cell range.
FormulaToken contains a single token within a formula. (OpCode of the token. Additional data in the token
FunctionArgument contains the description of a single argument within a spreadsheet function.
SingleReference contains a reference to a single cell (Column, RelativeColumn, Row, RelativeRow, Sheet, RelativeSheet, Flags).
FillDirection used to specify the direction of filling cells, for example, with a series
GeneralFunction used to specify a function to be calculated from values.
PasteOperation used to specify which operations are carried out when pasting cell values into a cell range.
SheetLinkMode used to specify how a sheet is linked to another sheet.
ValidationAlertStyle used to specify how invalid cell contents are treated.
AddressConvention These constants specify which address convention to use in the formula parser. Each variation specifies a different cell and cell range address syntax.
CellFlags These constants select different types of cell contents.
DataResultFlags: specify the result type of one element in the data pilot data array – HAS DATA,
SUBTOTAL, ERROR. (https://www.openoffice.org/api/docs/common/ref/com/sun/star/sheet/DataResultFlags.html)
FormulaMapGroup Constants of bit masks used with ::XFormurmulaOpCodeMapper::getAvailableMappings to specify for which group of symbols the mappings are to be obtained. If no bit is set, a sequence of special mappings is returned in the order that is defined by FormulaMapGroupSpecialOffset. Note that the special group and other groups are mutual exclusive.
FormulaResult used to select different result types of cell formulas
ReferenceFlags defines flags for references.
[TableValidationVisibility](http s://www.openoffice.org/api/docs/common/ref/com/sun/star/sheet/TableValidationVisibility.html) These constants specify whether and how a list of possible values of a cell should be shown.
A search on resulttype yields at least three results.
- MyBatis - lists of primitive types
Lupp, you have given me excelllent advice. I appreiate your help. To follow your excellent, technical references, I need something a little more detailed.