Get sheet name and info without using Excel application scope

How can I get sheet name and data (specific row) in dynamic using the activities in workbook?
To be more specific, I have an excel file which contains 15 sheets, I would like to get all sheet names in that excel file.
Then, I would like to get the data in the specified sheet name.

welcome to uipath community
we can do that with INVOKE CODE activity where we can mention the code to get all the sheet name from a excel

but using EXCEL APPLICATION SCOPE is very easy…may i know why you dont want to do with that

Cheers @pat_siv



I suppose there is no activity which we can get sheet name in Workbook category
However, there is CloseXML library which is used by activities in Workbook category and you can get sheet name using it even if there is no Excel in your pc.

I’ll attach sample as the following.

Sample.xaml (6.3 KB)



Hi ,
Here is an activity to get only sheets name




Because my professor want me to be able to work with various platform not just only using excel application scope. So, he forces me not to use excel application scope. :cry:
Thank you so much for your help, I will try following your advice.

cheers @Palaniyappan

1 Like

thank you so much for you advice. i will try it


1 Like

Excuse me sir, I have followed your advice but I got an new issue.
How can I solve this error? @Yoichi


It’s difficult to get it from only this image.
Can you share your workflow, or content of both assign activity as text?


Thank you once again for your help @Yoichi
Here is the activities I created,

  1. Assign Activity: filename = “Timesheet-201909.xlsx”
    Variable type: String

  2. Assign Activity: workbook = new ClosedXml.Excel.XLWorkbook(filename)
    Variable type: XLWorkbook

  3. Assign Activity: worksheets = workbook.Worksheets
    Variable type: IXLWorksheets

  4. For each activity: For each “item” in “worksheets” —> Message box: item.Name

Then, I save and run the file, and the output shown that
“Assign: Object reference not set to an instance of an object.”
Also shown the red square on the second assign activity as the above picture I attached.

Best regards.

1 Like


Thank you for your reply.
It seems there is no suspicious sentence in your code.

As other possibility, there might be some reason in your workbook to be unable to read by ClosedXML.
Can you try blank excel workbook (just right click to create xlsx) instead of your workbook?


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.