Excel - Select Cell(s)
Declaration
<AMEXCEL ACTIVITY="activate_cell" CONNECTBY="text (options)" WORKBOOK="text" INVISIBLE="YESNO" WORKBOOKTEMPLATE="text" OVERWRITE="YES/NO" SAVETYPE="text (options)" DESTINATION="text" OVERWRITEDESTINATION="YES/NO" ACTION="rangebyreference" UPPERLEFTREF="text" LOWERRIGHTREF="text" />
Description: Selects a cell or range of cells within the currently active worksheet.
Practical Usage
Used to activate a cell or range of cells in the active worksheet of a Microsoft Excel document. Ideal for selecting one or more cells in order to perform an activity, such as formatting the cells or entering values in them. Be aware that this activity works only on the active worksheet. To activate a specific worksheet, use the Activate worksheet activity.
Resource Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Resource |
|
|
|
|
Indicates where the source Excel document should originate from. This is a design mode parameter used only during task construction and configuration, thus, comprises no markup. The available options are:
|
Session |
Text |
Yes if Resource is set to Session |
Excelsession1 |
SESSION="mySession" |
The name of an existing session to associate this activity with. This parameter is active only if the Resource parameter is set to Session. |
Get document by |
Text (options) |
Yes if Resource is set to File |
Open |
|
Specifies whether this activity will be performed on an existing Excel document or on a new one. This parameter is active only if the Resource parameter is set to File. The available options are:
|
File name |
Text |
Yes |
(Empty) |
WORKBOOK="C:\Temp\file.xls" |
If the Get document by parameter is set to Open, specifies the path and filename of the Excel document in which to open. If the Get document by parameter is set to Create, specifies the path and filename of the Excel document in which to create. |
Application is invisible |
Yes/No |
No |
No |
VISIBLE="NO" |
If set to YES, specifies that the Excel window will not be displayed and all processing will occur in the background. This option should be set to NO during task construction and debugging but can be set to YES for production. The workbook is visible by default. |
Password to open (optional) |
Text |
No |
(Empty) |
OPENPASSWORD="encrypted" |
The password required to open the Excel document if it is password protected. This parameter is active only if the Get document by parameter is set to Open. |
Password to modify (optional) |
Text |
No |
(Empty) |
MODIFYPASSWORD="encrypted" |
The password required to modify the Excel document if it is password protected. This parameter is active only if the Get document by parameter is set to Open. |
Create from template |
Text |
No |
No |
WORKBOOKTEMPLATE="C:\Temp\file.xls" |
If enabled, specifies the path and filename of a template file that already has preferred formatting in which to base the new workbook on. A template can include formatting, styles, standardized text such as page headers and row and column labels, formulas, macros and custom toolbars. This parameter is active only if the Get document by parameter is set to Create. It is disabled by default. |
Overwrite if workbook already exists |
Yes/No |
No |
No |
OVERWRITE="yes" |
If set to YES, the newly created workbook will overwrite an existing workbook with the same name, If set to NO, an error will occur during runtime as a result of a matching filename. This parameter is active only if the Get document by parameter is set to Create. |
On completion |
Text (options) |
No |
Save |
|
Specifies what to do with the document upon completion of this activity. The available options are:
|
Overwrite if workbook already exists |
Yes/No |
No |
No |
OVERWRITEDESTINATION="YES" |
If set to YES, specifies that existing Excel files with matching names that exist in the destination will be overwritten. If set to NO, matching files will not be overwritten, however, a runtime error will occur as a result. Set to NO by default. |
Cell Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Get |
Text (optionss) |
Yes |
Cell by reference |
|
Specifies the cell selection method. The available options are:
|
Cell reference |
Text |
Yes if activate method is Cell by Reference |
(Empty) |
CELLREF="B3" |
The reference of the cell to activate. Active only if Cell by reference is the selected Activate parameter. |
Row |
Number |
Yes if activate method is Cell by position |
1 |
CELLROW="3" |
The row of the cell to activate. Active only if Cell by position is the selected Activate parameter. |
Column |
Number |
Yes if activate method is Cell by position |
1 |
CELLCOLUMN="2" |
The row of the cell to activate. Active only if Cell by position is the selected Activate parameter. |
Upper Left Cell |
Text |
Yes if activate method is Cell by reference |
(Empty) |
UPPERLEFTREF="A1" |
The reference of the upper left cell in the range of cells to activate. Active only if Range by reference is the selected Activate parameter. |
Lower Right Cell |
Text |
Yes if activate method is Cell by reference |
(Empty) |
LOWERRIGHTREF="C5" |
Specifies the reference of the lower right cell in the range of cells to activate. Active only if Range of cells by reference is the selected Activate parameter. |
Upper Left Cell Row |
Number |
Yes if activate method is Cell by position |
(Empty) |
UPPERLEFTROW="1" |
Specifies the row of the upper left cell in the range of cells to activate. Active only if Range of cells by position is the selected Activate parameter. |
Upper Left Cell Column |
Number |
Yes if activate method is Cell by position |
(Empty) |
UPPERLEFTCOLUMN="1" |
Specifies the column of the upper left cell in the range of cells to activate. Active only if Range of cells by position is the selected Activate parameter. |
Lower Right Cell Row |
Number |
Yes if activate method is Cell by position |
(Empty) |
LOWERRIGHTROW="14" |
The row of the lower right cell in the range of cells to activate. Active only if Range of cells by position is the selected Activate parameter. |
Lower Right Cell Column |
Number |
Yes if activate method is Cell by position |
(Empty) |
LOWERRIGHTCOLUMN="3" |
The column of the lower right cell in the range of cells to activate. Active only if Range of cells by position is the selected Activate parameter. |
Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.
Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)
On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)
Example 1 - Activate a single cell by position.
<AMEXCELACTIVATECELL SESSION="ExcelSess10" ACTION="cellbyposition" CELLROW="2" CELLCOLUMN="3" />
Example 2 - Activate a range of cells by position.
<AMEXCELACTIVATECELL SESSION="ExcelSess10" ACTION="rangebyposition" UPPERLEFTROW="2" UPPERLEFTCOLUMN="3" LOWERRIGHTROW="5" LOWERRIGHTCOLUMN="5" />