Activate Cell

Declaration

<AMEXCELACTIVATECELL SESSION="text" ACTION="text" CELLROW="number" CELLCOLUMN="number" />

See Also

Activate Cell | Activate Worksheet | Add Worksheet | Cells to Dataset | Close Workbook | Create Workbook | Dataset to Cells Action | Get Active Cell | Get Active Worksheet | Get Cell | Open Workbook | Set Cell

Description

Activates a cell or range of cells within the currently active worksheet in an established Excel session.

IMPORTANT: AutoMate'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.

Practical Usage

Used to activate a cell or range of cells in the active worksheet of a Microsoft Excel document that was previously created using the Create Workbook action or opened using the Open Workbook action. Ideal for selecting a cell or cells in order to perform an action, such as formatting the cells or entering values in them. Be aware that this action works only on the active worksheet. To activate a specific worksheet, use the Activate Worksheet action.

NOTE: This action is only useful in conjunction with other Excel actions found in AutoMate. It is not possible to use Automate's Excel actions on a spreadsheet that was not opened by the Open Workbook action or created by the Create Workbook action.

Parameters

General Properties

Property

Type

Required

Default

Markup

Description

Session Name

Text

Yes

ExcelSess1

SESSION="Session7"

Specifies the session name to identify which document should be acted on. 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 name, which is Excelsess1.

Activate

Text

Yes

Cell By Reference

ACTION=

"rangebyposition"

Specifies the cell selection method. The available options are:

  • Cell by reference (Default): Activates a single cell, selected by its cell reference such as A1 or B3.

  • Cell by position: Activates a single cell, selected by its row and column position.

  • Range by reference: Range of cells by reference. Activates a range of cells, selected by the cell reference for the upper left and lower right cells in the range.

  • Range by position: Range of cells by position. Activates a range of cells selected by the row and column positions of the upper left and lower right cells in the range.

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 Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

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" />

 

↑ Top of Page