Delete sheet Version 1 (Python)
Action group: Office
Description
The action deletes a sheet from the document. The only existing sheet cannot be deleted, an error will be thrown. The active sheet is not changed if it is not the one selected for deletion. If the active sheet is deleted, the next sheet in the order, if it exists, becomes active. If the next sheet does not exist, the previous sheet is activated
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Context | Action context for ods/xlsx document | Robin.OpenSheetD oc | Yes | |
Sheet identification method | The parameter sets the identification method of the sheet to delete: via name or index | Robin.String | Yes | |
Sheet name | The name of the sheet to be deleted | Robin.String | No | |
Sheet index | The sequence number of the sheet to be deleted. The sequence number starts with «1» | Robin.Numeric | No |
Special conditions of use
None.
Example of use
Task
There is a document called Test with two sheets - Sheet 1 and Sheet 2. You need to delete Sheet 2 from the document.
Solution
Use the actions "Open", "Delete sheet", "Save".
Implementation
- Assemble a robot scheme consisting of actions:
Set the "Path to file" parameter for the "Open" action.
- Set parameters for the "Delete sheet" action. In the "Context" field specify the open document context, in the "Sheet identification method" field specify "by sheet name". In the "Sheet name" field specify "Sheet 2".
- Set the parameter 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 program robot completed successfully.
The sheet named "Sheet 2" has been successfully deleted from the document.
Обзор
Инструменты контента