Activate sheet Version 6 (Net)
Action group: Excel
Description
Sets the active sheet of the document.
Icon
Settings of parameters
Property | Description | Type | Example of filling in | Obligatory to fill in the field |
---|---|---|---|---|
Parameters | ||||
Context | The unique identifier of the session to which the action will be applied. | Excel instance | EXCEL_INSTANCE | Yes |
Sheet identifier | Specifies whether the sheet will be defined via name or index. Drop-down list:
After selecting the value of this field, the action will refer to either the value of the "Sheet name" field or the value of the "Sheet index" field. | String | Sheet index | Yes |
Sheet name | The name of the sheet to which the action will be applied. | String | Sheet1 | No |
Sheet index | The sequence number of the sheet to which the action will be applied. | Numeric | 1 | No |
Special conditions for use
If the parameter points to a hidden sheet, the action will result in an error.
If both parameters "Sheet name" and "Sheet index" are not specified, an error will be generated.
Example of use
Task
There is an Excel document called "Test" with three tabs Sheet1, Sheet2, Sheet3. The active tab is Sheet1. It is necessary to make the Sheet3 tab active.
Solution
Use the actions "Open", "Activate sheet", "Save".
Implementation
- Assemble a robot scheme consisting of actions:
- Configure parameters for the "Open" action. In the "PathToFile" field, specify the path to the required Excel file. Check the "Open Visible" = true checkbox to display the robot actions on the screen.
- Customize parameters for the "Activate sheet" action. In the "Context" field specify the context of the opened document, in the "Sheet identification method" field specify " Via sheet name", in the "Sheet name" field specify the name of the sheet to be made active (in this case "Sheet3").
- Configure parameters for the "Save" action. Specify the context of the Excel document in the "Context" parameter.
- Launch the robot using the "Start" button in the top panel.
Result
The software robot completed successfully. Sheet 3 in the Excel document is activated.