Hello All,
I want to read the data from different sheets in same workbook, but i don’t know the number of sheets.
how can i do this ?
Thanks and Regards,
Parvati Thalal
Hello All,
I want to read the data from different sheets in same workbook, but i don’t know the number of sheets.
how can i do this ?
Thanks and Regards,
Parvati Thalal
Hi @parvati
Please refer to this post to know how to loop through sheets:
Hope this helps.
Thanks and regards
@parvati - Inside excel application scope → get the workbook object → In assign activity workbookobject.Sheets.count;
Example as in c#:
Workbook workBook = _excelApp.Workbooks.Open(“d:/Book1.xls”);
int numSheets = workBook.Sheets.Count;
Hello @parvati,
This might be helpful (the output of Excel Application Scope
is variable “workbook”):
i want to read the data from those sheets and paste it in some other excel.
but i dont know the exact number of sheets,so how can i do this using for each?
number of sheets available in that workbook i don’t know i want to iterate through for each…
Thnaks and Regards,
Parvati Thalal
in read range what i have to specify?
Sorry a little mistake from my site. You need to assign “workbook.GetSheets” to variable of IEnumerable type, then in For Each
loop your “item” argument needs to be also IEnumerable type. And rest of it as below on the screen:
i want all the data to be pasted in same sheet,
not in different sheets…?