how can i make so that in the next loop it will use the next sheet as listed below ? (and still in that specific O cell) :
You can use excel to store sheet names then use for each row and pass sheet name as variable.
how can i do that and what action do i have to use to store sheet name ?
→ Read the excel sheet which contains the list of sheet names by using the Read range workbook activity and store in a datatable variable called dt.
→ Then use the for each row in datatable activity to iterate the each row in dt variable.
→ Inside for each row in datatable activity insert the assign activity to store the sheet name.
- Assign -> Sheetname = Currentrow("Column name")
→ After assign activity use the write cell activity to write the data in O1 cell in different sheets.
→ Give as below in the where to write field in write cell activity.
excel.sheet(Sheetname).toString.Cell("O1")
Hope it helps!!
in the read range workbook what is the sheet name that i have to use ?
in the assign what is the save to and value to save ?
You have all the sheet names in a excel sheet right… @mdaffakhairy
Give the excel file path and sheet name.
In assign activity give as like below,
- Assign -> Sheetname = Currentrow("Column name")
You are getting the sheet names in a excel sheet or any other source. Could you give me clarification on this.
yes i’m getting the list of sheet names from an excel file called ‘daerah.xlsx’ and in a row called ‘area chart’ here is what i made based on your instruction :
i have to write cell into another different excel file (not daerah.xlsx)
Let’s clarify the Excel file names, The Excel file which consists of sheet names in a the ‘area chart’ column is ‘daerah.xlsx’. Let’s say another Excel name is ‘Sample.xlsx’ where you want to right the data.
Follow the below steps,
→ Use the Excel Process scope activity and insert the Use excel file activity inside of it.
→ Give the Path of the ‘Sample.xlsx’ file to the Use excel file activity.
→ Inside Use excel file activity insert the Read range workbook activity and give the path of the ‘derah.xlsx’ and give the sheet name where the list of sheet names stored. create a output variable to it, let’s say the variable name is DT.
→ After Read range workbook activity, use the for each row in datatable activity to iterate the each row in the DT.
→ Inside For each row in datatable activity insert the Assign activity and create a variable called SheetName.
- Assign -> SheetName = CurrentRow("area chart").toString
→ After Assign activity insert the Write cell activity and give the value in the what to write field and give the below in where to write field.
Excel.Sheet(SheetName.toString).Cell("O1")
Hope it helps!!
Check the below workflow for better understanding… @mdaffakhairy
thank you your solution worked
It’s my pleasure… @mdaffakhairy
Happy Automation!!
give screenshot output is more easy to fresher understand. keep Rocking
Yes, it will be more easier for the freshers and who are new to UiPath.
Thank you… @MD_Farhan1
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.