How to fetch sheet name of excel file in variable


How can I fetch sheet name of excel file in a variable.

I am unable to understand answer in link How to get the Sheet name from Excel


Have you tried to download the badita’s workflow example and check it ?


I got answer my self … I will share with you.

Create excel application scope and pass address of you excel

then, set output variable of this excel application scope

then create variable sheet name = excelWorkbooVariable.GetSheets(0)

1 Like

That’s exactly what the example does :smiley:

Good to hear that you figured out.



I have one more question.

How can I get row count of particular value in excel.

@piyush.2224…Why not pass through the training materials or academy?

1 Like

you could write a formula in another cell which writes the row number then read that value with ui path. or read the entire sheet and loop in the datatable using “for each row” activity and a counter variable

This is not working for me. I am getting Type ‘Workbook Application’ not defined error

I had some workmate which had similar issue with the latest release.
The intellisense was not popping up with the latest excel activities packages.

Could you please try Ctype(ExcelWorkbookScope,UiPath.Excel.WorkbookApplication).GetSheets(0)
Insure also that you are inside of the application scope or that you set an output variable on the Excel Application Scope Activity…

1 Like