jamnanin
(Naresh Jamnani)
January 31, 2018, 5:58am
1
I am trying to read only the 1st sheet of all the excel files in a directory. But the problem is while using read range I have to specify the sheet name but the sheet names are different for all the excel files. How can I ask it to read only the 1st sheet irrespective of the name in the for each loop?
1 Like
MAHESH1
(MAHESHKUMAR JV)
January 31, 2018, 6:04am
2
@jamnanin
Try this in place of sheetname in Read Range Activity
Excelsheet1=xlwbook.Sheets.Item(1)
Regards,
Mahesh
jamnanin
(Naresh Jamnani)
January 31, 2018, 6:15am
4
I am getting an error on this
Dominic
(Dominic)
January 31, 2018, 6:22am
5
@jamnanin , Follow this links,
Hey @NatsuOK
Yes you have to pass the sheet name in Read Range activity to read that sheet data.
You can use the sheet directly by passing the index like "wb.GetSheets(0).
where wb is
[image]
Best Regards…!!
Aksh
Hello there,
Yes you can.
Use excel application scope activity ,
create output variable from the property called workbook(eg:wb)
To see the sheet name just use write line and pass like this wb.GetSheets(0).
Then use Read range and in the sheet pass like this wb.GetSheets(0).
PS: make sure to use that outside the excel scope(means you need to add one more excel scope and use read range there)
Regards,
Dominic
2 Likes