activities
latest
false
UiPath logo, featuring letters U and I in white
Productivity Activities
Last updated Nov 6, 2024

Copy Sheet

UiPath.MicrosoftOffice365.Activities.Excel.CopySheet

Description

Uses the Microsoft Graph Get range, Add worksheet, and Update range APIs to copy an existing worksheet (CopySheet) in a specified workbook (CopyWorkbook) and then paste it as a new worksheet (PasteSheet) into the same or a different workbook (PasteWorkbook). The copied worksheet is pasted at the end of the existing worksheets in the workbook.

Important: Because of Graph API limitations, this activity does not copy the formats, only text and formulas.
Scopes

This activity requires the following scopes:

  • Files.ReadWrite

OR

  • Files.ReadWrite.All

OR

  • Sites.ReadWrite.All

Project compatibility

Windows - Legacy | Windows

Configuration

Properties

Common
  • DisplayName - The display name of the activity. This property supports String variables and string formatted values.
Input
  • CopySheet - Name of the sheet to copy. This property supports String variables and string formatted values.
  • Copy Workbook - The DriveItem of the Excel document whose sheet is copied. Use the output property variable from either the Find Files and Folders (First or Results) or Create Workbook (Workbook) activities. When using the Results output property from the Find Files and Folders activity, be sure to specify which item in the array that you want to use (e.g., myWorkbooks(0)).
  • Paste Sheet - The name of the sheet after copying. If you don't specify a value, the PasteSheet name will be the same as the CopySheet name. If you paste the PasteSheet inside the same workbook as the CopyWorkbook, a "n" is added at the end of the sheet name (e.g., Sheet1n). If the PasteSheet name is the same as an existing sheet, the existing sheet content will be overwritten by the CopySheet data (i.e., a new sheet is not created with the PasteSheet name and "n" appended to the end).
  • Paste Workbook - The DriveItem of the Excel document into which the sheet is pasted. Use the output property variable from either the Find Files and Folders (First or Results) or Create Workbook (Workbook) activities. When using the Results output property from the Find Files and Folders activity, specify the item in the array that you want to use (e.g., myWorkbooks(0)). You can use the same variable as the CopyWorkbook if you want to copy/paste the sheet into the same workbook.
Misc
  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level. This field supports Boolean values.

How it works

The following steps and message sequence diagram is an example of how the activity works from design time (i.e., the activity dependencies and input/output properties) to run time.

  1. Complete the steps.
  2. Add the Microsoft Office 365 Scope activity to your project.
  3. Add an activity or run an external process that outputs a DriveItem object (e.g., Find Files and Folders, Create Workbook, Copy Item).
  4. Add the Copy Sheet activity inside the Microsoft Office 365 Scope activity.
  5. Enter values for the Input properties.
  6. Run the activity.

    • Your input property values are sent to the GetRange, AddWorkbookWorksheet, and UpdateRange APIs.



  • Description
  • Project compatibility
  • Configuration
  • How it works

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.