Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Delete sheet Version 1 (Python)

...

Action group:

...

Office

Описание

Действие удаляет лист из документа. Единственный существующий лист удалить нельзя, будет вызвана ошибка. Активный лист не меняется, если не он был выбран на удаление. Если был удален активный лист, то активным становится следующий по порядку, если он существует. Если следующего листа не существует, активизируется предыдущий

Image Removed

Настройки

...

Свойство

...

Описание

...

Тип

...

Пример заполнения

...

Обязательность заполнения поля

...

Параметры

...

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

Image Added

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextAction context for ods/xlsx documentRobin.OpenSheetD oc
Yes
Sheet identification methodThe parameter sets the identification method of the sheet to delete: via name or indexRobin.String
Yes
Sheet nameThe name of the sheet to be deletedRobin.String
No
Sheet indexThe 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

  1. Assemble a robot scheme consisting of actions: 
    Image Added


  2. Set the "Path to file" parameter for the "Open" action.  

      Image Added

  3. 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". 

    Image Added
  4. Set the parameter for the "Save" action. Specify the context of the Excel document in the Context parameter.
     
    Image Added
  5. 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. 

Image Added

 

...

Контекст

...

Контекст действия для работы с таблицей ods/xlsx

...

Robin.OpenSheetDoc

...

Да

...

Способ идентификации листа

...

Параметр задает способ идентификации листа для удаления: через имя или индекс

...

Robin.String

...

Да

...

Имя листа

...

Наименование листа, который будет удален

...

Robin.String

...

Нет

...

Индекс листа

...

Порядковый номер листа, который будет удален. Порядковый номер начинается с «1»

...

Robin.Numeric

...

Нет

Особые условия использования

Отсутствуют

Пример использования 

Задача: имеется документ под названием Test с двумя листами - Лист 1 и Лист 2. Необходимо удалить Лист 2 из документа. 

Решение: воспользоваться действиями "Открыть", "Удалить лист", "Сохранить". 

Реализация: 

...

Настроить параметр для действия "Открыть" (указать путь к файлу). 

  Image Removed

...

Результат: Программный робот отработал успешно.  Лист под названием "Лист 2" успешно удален из документа. 

Image Removed