История страницы
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.
Удалить лист / Delete Sheet
Группа действий: Офис
Действие удаляет лист из документа. Единственный существующий лист удалить нельзя, будет вызвана ошибка. Активный лист не меняется, если не он был выбран на удаление. Если был удален активный лист, то активным становится следующий по порядку, если он существует. Если следующего листа не существует, активизируется предыдущий
Настройки
...
Свойство
...
Описание
...
Тип
...
Пример заполнения
...
Обязательность заполнения поля
...
Параметры
...
Контекст
...
Контекст действия для работы с таблицей ods/xlsx
...
Robin.OpenSheetDoc
...
Да
...
Способ идентификации листа
...
Параметр задает способ идентификации листа для удаления: через имя или индекс
...
Robin.String
...
Да
...
Имя листа
...
Наименование листа, который будет удален
...
Robin.String
...
Нет
...
Индекс листа
...
Порядковый номер листа, который будет удален. Порядковый номер начинается с «1»
...
Robin.Numeric
...
Нет
Особые условия использования
Отсутствуют
Пример использования
Задача: имеется документ под названием Test с двумя листами - Лист 1 и Лист 2. Необходимо удалить Лист 2 из документа.
Решение: воспользоваться действиями "Открыть", "Удалить лист", "Сохранить".
Реализация:
...
Настроить параметр для действия "Открыть" (указать путь к файлу).
...
Результат: Программный робот отработал успешно. Лист под названием "Лист 2" успешно удален из документа.