Retrieves the position of the currently active cell or range of cells in an established Excel session and populates one or more variables with the cell reference or position coordinates. Use the Activate Cell action to activate a cell or range of cells in an established worksheet. Used to get the currently active cell or range of cells associated with the active worksheet in a Microsoft Excel document that was previously created using the Create Workbook action or opened using the Open Workbook action.
Declaration
<AMEXCELGETACTIVECELL SESSION="text" ACTION="text(options)" UPPERLEFTROWVARIABLE="text" UPPERLEFTCOLUMNVARIABLE="text" LOWERRIGHTROWVARIABLE="text" LOWERRIGHTCOLUMNVARIABLE="text" />
Example
Get active cell in workbook open in session "Session 102". Populate variable "topLeftRow" with the row of the cell in the upper left corner of the selection. Populate variable "topLeftColumn" with the column # of the cell in the upper left corner of the selection. Populate variable "bottomRightRow" with the row of the cell in the lower right corner of the selection. Populate variable "bottomRightColumn" with the column # of the cell in the lower right corner of the selection.
<AMEXCELGETACTIVECELL SESSION="Session 102" ACTION="rangebyposition" UPPERLEFTROWVARIABLE="topLeftRow" UPPERLEFTCOLUMNVARIABLE="topLeftColumn" LOWERRIGHTROWVARIABLE="bottomRightRow" LOWERRIGHTCOLUMNVARIABLE="bottomRightColumn" />
See Also: Create Workbook, Open Workbook, Close Workbook, Add Worksheet, Activate Worksheet, Set Cell, Cells to Dataset, Dataset to Cells
|
AWE's Excel actions use Microsoft's Excel automation engine to perform their work. Therefore, Microsoft Excel must be licensed and installed on the system in order for these actions to work. Excel objects run in the context of the user executing them. If EFT is running as a Local System, then the Excel object is executed using the Local System profile. Before using an Excel action in Event Rules, refer to Globalscape Knowledgebase article #11089 for important information. This action is only useful in conjunction with other Excel actions. It is not possible to use AWE's Excel actions on a spreadsheet that was not opened by the Open Workbook action or created by the Create Workbook action. |
Property |
Type |
Required |
Default |
Markup |
Description |
Session Name |
Text |
Yes |
ExcelSess1 |
SESSION="ExcelSess7" |
The name of the session to associate with this Excel action. Numerous sessions can exist within a single task allowing several spreadsheets to be open simultaneously. If working with only one document, this can remain at the default session name, which is Excelsess1. |
Get Active |
Text (options) |
Yes |
Cell by Reference |
ACTION="rangebyposition" |
Specifies the method in which this action retrieves the active cell or range of cells. The available options are:
|
Populate Variable with Cell Reference |
Text |
No |
(Empty) |
CELLREFVARIABLE="refVar" |
The name of the variable to populate with the cell reference. Active only if Cell by reference is the selected Activate parameter. |
Populate Variable With Row |
Number |
No |
(Empty) |
CELLROWVARIABLE="rowVar" |
The variable to populate with the cell row. Active only if Cell by position is the selected Get Active parameter. |
Populate Variable With Column |
Number |
No |
(Empty) |
CELLCOLUMNVARIABLE= "columnVar" |
The variable to populate with the cell column. Active only if Cell by position is the selected Get Active parameter. |
Populate Variable With Upper Left Cell |
Text |
No |
(Empty) |
UPPERLEFTREFVARIABLE= "upperLeftVar" |
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 reference is the selected Get Active parameter. |
Populate Variable With Lower Right Cell |
Text |
No |
(Empty) |
LOWERRIGHTREFVARIABLE= "lowerRightVar" |
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 reference is the selected Get Active parameter. |
Populate Variable With Upper Left Cell Row |
Yes/No |
No |
(Empty) |
UPPERLEFTROWVARIABLE= "upLeftCellRow" |
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 is the selected Get Active parameter. |
Populate Variable With Upper Left Cell Column |
Text |
No |
(Empty) |
UPPERLEFTCOLUMNVARIABLE= "upLeftCellColumn" |
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 is the selected Get Active parameter. |
Populate Variable With Lower Right Cell Row |
Text |
No |
(Empty) |
LOWERRIGHTROWVARIABLE= "lowRightCellRow" |
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 is the selected Activate parameter. |
Populate Variable With Lower Right Cell Column |
Text |
No |
Sheet1 |
LOWERRIGHTCOLUMNVARIABLE= "lowRightCellColumn" |
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 is the selected Activate parameter. |