Raname sheets

Hello All, a small help needed
I want to rename a sheet with the data which is there in that sheet A1.
For example- in a excel file Input.xlsx, in sheet1 the string data in A1 is “Profit”
My bot should rename the sheet name from sheet1 to Profit… How to do it?

Excuse my Typos
Thanks

Hi,

Can you try as the following image?

Regards,

@Pranay_Kumar_Bose

  1. Open the UiPath Studio.
  2. Create a new project and add an Excel Application Scope activity.
  3. In the Excel Application Scope activity, provide the path to the Excel file that you want to rename the sheet in.
  4. Add a Rename Sheet activity inside the Excel Application Scope activity.
  5. In the Rename Sheet activity, set the following properties:
    NewSheetName: The new name of the sheet. This will be the data that is in A1 of the sheet.
    OriginalSheetName:The name of the sheet that you want to rename. In this case, it will be “Sheet1”.
    Workbook:The DriveItem of the workbook whose sheet is renamed. This can be obtained from the output property of the Find Files And Folders activity.

I have more than 1 sheet and I want to do it for each one!!!

@Pranay_Kumar_Bose

Create a list or array and give sheetnames

Take for each
In “To” section in rename:Give Currentitem

@Pranay_Kumar_Bose

Use the below workflow and take the variables as below mentioned data types.



Input Excel

Ouput Excel

Hope it helps!!

Hi,

Can you try the following sample?

Sample20230729-1aL.zip (3.0 KB)

Regards,

1 Like

Hi @Pranay_Kumar_Bose

Step 1 => Take Use excel file activity and give the path of the excel file
Step 2 => Inside use Excel file activity insert the read cell activity to read the cell A1 in range give like below.
Excel.Sheet(“Sheet1”).Cell(“A1”)
Store the output in a string variable.
Step 3 => after read cell insert the rename sheet activity.
Give the range Excel.Sheet(“Sheet1”) in from field.
Pass the String variable in to field in rename sheet activity.

Hope it helps!!

@Yoichi
@vrdabberu
Thanks for the solution.
Both the solution are easier to understand and fulfills my requirement,
but marking only one as solution for thread closure.

2 Likes

@Pranay_Kumar_Bose

Your welcome

Happy Automation!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.