Get Active Cell Action

Description

Retrieves the position of the currently active cell or cells in an established Excel session (a Microsoft Excel document that was previously created or opened using one of Automated Workflow's Excel actions). The action populates one or more variables with the cell reference or position coordinates. This action is only useful in conjunction with the other Excel actions found in Automated Workflow.

IMPORTANT: The Excel actions in Automated Workflow use the Microsoft Excel automation engine to perform their work. Because of this Microsoft Excel must be licensed and installed on the system to use the Excel Actions.

Declaration

<AMEXCELGETACTIVECELL SESSION="Text"  ACTION="Text [options]" CELLREFVARIABLE="Text" CELLROWVARIABLE="Text" CELLCOLUMNVARIABLE="Text"  UPPERLEFTREFVARIABLE="Text" LOWERRIGHTREFVARIABLE="Text"  UPPERLEFTROWVARIABLE="Text" UPPERLEFTCOLUMNVARIABLE="Text" LOWERRIGHTROWVARIABLE="Text" LOWERRIGHTCOLUMNVARIABLE="Text" />

Example

<AMEXCELGETACTIVECELL SESSION="ExcelSess1" ACTION="rangebyposition" UPPERLEFTROWVARIABLE="VariableName1" UPPERLEFTCOLUMNVARIABLE="VariableName2" LOWERRIGHTROWVARIABLE="VariableName3" LOWERRIGHTCOLUMNVARIABLE="VariableName4" />

General Tab Parameters

Session name: Specifies the session name to identify which document should be acted on. This allows several Excel files to be open simultaneously. If working with only one document, this value should not be changed from its default value.

Text, Optional - Default "ExcelSess1"
MARKUP: SESSION="ExcelSess2"

Get Active: Specifies the cell designation method. Options are:

  • (Default) Cell by reference. Returns a single cell reference such as A1 or B3. If more than one cell is active, returns the upper left.

  • cellbyposition: Cell by position. Returns row and column positions for a single cell. If more than one cell is active, returns the upper left.

  • rangebyreference: Range of cells by reference. Returns the reference designations for the upper left and lower right cells in the active range of cells.

  • rangebyposition: Range of cells by position. Returns the row and column positions of the upper left and lower right cells in the active range of cells.

Text [options], Optional - default "cell by reference"
MARKUP: ACTION="rangebyposition"

Populate variable with cell reference: Specifies the variable to populate with the cell reference. Active only if Cell by reference [Default] is the selected Activate [ACTION] parameter.  

Text, Required if active
MARKUP: CELLREFVARIABLE="VariableName"

Populate variable with row: Specifies the variable to populate with the cell row. Active only if Cell by position [CELLBYPOSITION] is the selected Activate [ACTION] parameter.

Text, Required if active
MARKUP: CELLROWVARIABLE="VariableName"

Populate variable with column: Specifies the variable to populate with the cell column. Active only if Cell by position [CELLBYPOSITION] is the selected Activate [ACTION] parameter.  

Text, Required if active
MARKUP: CELLCOLUMNVARIABLE="VariableName"

Populate variable with upper left cell: Specifies the variable to populate with the reference for the upper left cell in the range of active cells. Active only if Range of cells by reference [rangebyreference] is the selected Activate [ACTION] parameter.

Text, Required if active
MARKUP: UPPERLEFTREFVARIABLE="VariableName"

Populate variable with lower right cell: Specifies the variable to populate with the reference for the lower right cell in the range of active cells. Active only if Range of cells by reference [rangebyreference] is the selected Activate [ACTION] parameter.

Text, Required if active
MARKUP: LOWERRIGHTREFVARIABLE="VariableName"

Populate variable with upper left cell row: Specifies the variable to populate with the row number of the upper left cell in the range of active cells. Active only if Range of cells by position [rangebyPOSITION] is the selected Activate [ACTION] parameter.

Text, Required if active
MARKUP: UPPERLEFTROWVARIABLE="VariableName"

Populate variable with upper left cell column: Specifies the variable to populate with the column number of the upper left cell in the range of active cells. Active only if Range of cells by position [rangebyPOSITION] is the selected Activate [ACTION] parameter.

Text, Required if active
MARKUP: UPPERLEFTCOLUMNVARIABLE="VariableName"

Populate variable with lower right cell row: Specifies the variable to populate with the row number of the lower right cell in the range of active cells. Active only if Range of cells by position [rangebyPOSITION] is the selected Activate [ACTION] parameter.

Text, Required if active
MARKUP: LOWERRIGHTROWVARIABLE="VariableName"

Populate variable with lower right cell column: Specifies the variable to populate with the column number of the lower right cell in the range of active cells. Active only if Range of cells by position [rangebyPOSITION] is the selected Activate [ACTION] parameter.

Text, Required if active
MARKUP: LOWERRIGHTCOLUMNVARIABLE="VariableName"

See Also

Create Workbook, Open Workbook, Close Workbook, Add Worksheet, Activate Worksheet,  Set Cell, Cells to Dataset, Dataset to Cells