Mr.H
December 29, 2020, 3:20am
1
Hi Everyone.
I want to loop all sheets in excel file and got sheet name if that sheet contain 3 columns with name “code” “name” “quantity”. And then Read Range from index which contains these column names
How to do that ?
Thansk you!
Book1.xlsx (9.2 KB)
sarathi125
(Parthasarathi)
December 29, 2020, 4:19am
2
@Mr.H
Try something like this,
2 Likes
@Mr.H - Here you go…Get Workbook Sheets.xaml (14.1 KB)
Output:
1 Like
Most basic way, I think there is an activity called Get sheets
UiPath.Excel.Activities.ExcelGetWorkbookSheets Returns a list of all the sheet names in a workbook as String variables, ordered by their index. Properties Common DisplayName - The display name of the activity. Misc Private - If selected, the values...
Use it to get a list of sheets into a collection
Loop through the sheets and for each sheet,
Read Range by limiting the range to just get the first row into a Datatable.
Obviously, If the first row of the Datatable has names that you require, then you read the data from this sheet.
The jndex of the column will give you the position of each column
Hope this helps.
2 Likes
Mr.H
December 29, 2020, 4:26am
5
Hi Bro.
Thanks you but how to check row index ( in Sheet2 is row(1) contain these columns )
If row(1) not contain, it will return false
@Mr.H - Both @sarathi125 and I have provided the solution , which has the answer you are looking for. Did you opened my xaml?
1 Like
Mr.H
December 29, 2020, 4:55am
7
Thanks you bro.
I have another question.
After get Sheet Name… how to change it into another name ?
sarathi125
(Parthasarathi)
December 29, 2020, 4:58am
8
@Mr.H ,
If you need to rename the sheet in the workbook, then use UiPathTeam.Excel.Extensions.Activities.
https://feed.uipath.com/packages/UiPathTeam.Excel.Extensions.Activities/1.0.7018.25224
2 Likes
system
(system)
Closed
January 1, 2021, 5:07am
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.