Procedure Spreadsheet::RetrieveParameter(Workbook, Parameter, Range, Sheet, Transposed)


The procedure Spreadsheet::RetrieveParameter reads data from the given range in the Excel or OpenOffice Calc workbook into the specified AIMMS parameter.

        Workbook,       ! (input) scalar string expression
        Parameter,      ! (output) identifier
        Range,          ! (input) scalar string expression
        [Sheet],        ! (optional) scalar string expression
        [Transposed]    ! (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


The AIMMS identifier to be filled with spreadsheet data. This can be a numerical parameter, an element parameter, a string parameter, a unit parameter or a variable. The dimension of the parameter can be 0, 1 or 2.


The range in the workbook based on which the parameter must be filled.


The sheet in which the Range lies. Default is the active sheet.


If this argument is 1, the parameter is read transposed from the sheet. The argument does not have any effect on scalar and one-dimensional data. The default value for this argument is 0.

Return Value

The procedure returns 1 on success, or 0 otherwise. In case of an error the pre-defined AIMMS parameter CurrentErrorMessage contains a description of what went wrong.


  • By calling the procedure Spreadsheet::SetActiveSheet you 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 ExcelRetrieveParameter, which has become deprecated as of AIMMS 3.12.