- Procedure Spreadsheet::RetrieveTable(Workbook, Parameter, DataRange, RowsRange, ColumnsRange, Sheet, AutomaticallyExtendSets)¶
Spreadsheet::RetrieveTable reads tabular data from the
specified Excel or OpenOffice Calc workbook.
Spreadsheet::RetrieveTable( Workbook, ! (input) scalar string expression Parameter, ! (output) identifier DataRange, ! (input) scalar string expression [RowsRange], ! (optional) scalar string expression [ColumnsRange], ! (optional) scalar string expression [Sheet] ! (optional) scalar string expression [AutomaticallyExtendSets] ! (optional) scalar binary expression )
A scalar string expression representing the Excel or Calc workbook. If this argument ends in
.ods, OpenOffice Calc is used. Otherwise, Excel is used.
The AIMMS parameter in which the data read from the spreadsheet will be stored. This can be a numerical parameter, an element parameter, a string parameter, a unit parameter or a variable. The identifier must have a dimension greater than or equal to 1.
The range in the workbook from which the data must be read.
The range in the workbook from which the row labels must be read. The row labels will be added to the sets that are identified by the first indices of Parameter. If the RowsRange is an \(m \times n\)-matrix (m columns, n rows), then the row labels are the elements of the sets of the first :math:`m` indices of Parameter.
The range in the workbook from which the column labels must be read. The column labels will be added to the sets that are identified by the remaining indices of Parameter (the indices after those that constitute the RowsRange).
The sheet to which the Parameter should be written. Default is the active sheet.
Indicates whether AIMMS should automatically extend the domain set of an identifier if necessary. If not, an error will be generated. The default value of this argument is 0.
The procedure returns 1 on success, or 0 otherwise. In case of an error the pre-defined AIMMS parameter
CurrentErrorMessagecontains a description of what went wrong.
By calling the procedure
Spreadsheet::SetActiveSheetyou can set the active sheet, after which the optional sheet argument can be omitted in procedures like this one.
A call to this procedure with a specified sheet argument does not change the active sheet, except when the workbook does not have an active sheet yet.
Upto AIMMS 3.11 this function was known as
ExcelRetrieveTable, which has become deprecated as of AIMMS 3.12.