Hello I want to read sheet name of an excel file .
I am unable to understand example How to get the Sheet name from Excel
hence want guidance in simple terms
Hello I want to read sheet name of an excel file .
I am unable to understand example How to get the Sheet name from Excel
hence want guidance in simple terms
Hello @piyush.2224
Firstly you have to use âExcel application scopeâ activity to get the workbook from your excel file.
Then, you can obtain all the sheets names of the excel with workbook.GetSheets.
Hey @piyush.2224
please find following sample attached workflow and let me know
Sheets.xaml (6.9 KB)
RegardsâŚ!!
Aksh
In the above solution,I think the typearguement in For each loop should be string
Sheets.xaml (6.9 KB)
Yeah⌠2 month ago was working with other things with workbook object. so forgot to change it here . but edited.
RegardsâŚ!!
I assumed that. Not seeing you much around these days, seem to be busy?
Work Load will begin from May (a lot) so will be in your shoes then.
haha ⌠now just trying something nasty So Lets see what future is holding with it for me lol
i need to get the hidden sheet names in the excel workbookâŚwhat should i do
Hey @niridi
You can also get the hidden sheet name as well form Excel Workbook Object.
Test.xlsx (10.9 KB)
hidden sheet.xaml (6.9 KB)
IN the above excel Sheet2 and Sheet6 are hidden.
when you will run the sample still u will be able to get those sheet name with other visible sheet name as well.
RegardsâŚ!!
Aksh
its working good
thanks!!!
i want to get only the hidden sheet name instead of getting all the sheets in the workbook
The example you provided is not working. Iâm getting following error: : Unable to cast COM object of type âSystem.__ComObjectâ to interface type âMicrosoft.Office.Interop.Excel.Worksheetâ. This operation failed because the QueryInterface call on the COM component for the interface with IID â{000208D8-0000-0000-C000-000000000046}â failed due to the following error: En sĂĽdan grĂŚnseflade understøttes ikke (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
What is the solution of getting all sheets names within a workbook?
@aksh1yadav do you happen to know how we can get around this issue posted by @Ohrid?
I believe, in my case, it is because the Excel file has a Chart on a sheet.
Excel Package Version 2.3.6682.26635
I tried reinstalling the Excel package and am on the most recent.
I have tried multiple machines and with admin rights.
I am using wb.GetSheets()
when the error occurs.
If there isnât a known solve for this, I will escalate it to UiPath Support.
Regards.
C
Hi @ClaytonM,
Can you try this âWorkBook.GetSheets.ToList()â .
Below It has the example
Regards
Balamurugan
Thanks, adding .ToList didnât help.
It only happens when there is a Chart as one of the sheets.
I reproduced issue with a new file:
Excel file with Chart on a New Sheet: test1.xlsx (11.3 KB)
Thanks.
Hi @ClaytonM,
Yes. You are right. It is giving error only to have the chart. It doesnât have cells only the chart . I copied chart into another excel file. And tried to get the sheets count . It is working.
Regards
Balamurugan