How to get the Sheet Names of an Excel File in UiPath
Excel Application is a widely used in Business process Automation.
We will use excel automation pretty much in every automation process.
Either to get the data for the automation process or to report the status of the automation process to the business users.
In this article, we are going to see how we can get the sheet names of an excel file.
To achieve this you need to have an excel file.
The first step would be to get the workbook properties output from the excel application scope.
Use an Excel application scope and quickly take a look at the below properties
The main important property is the output- Workbook property.
Which will give you the required workbook properties for that excel that is given as input to the excel application scope.
As we got all the required workbook properties for the excel, let’s go ahead and see how to get the sheet names of that excel.
This is the command which holds all the sheet names.
Where excelworbook is the output variable from excel application scope.
Finally, to get each sheet name from the excelworkbook.GetSheets we are using a for each.
Now each item in this for each will give you the sheet name as below:
The output in the message box describes the sheet name.