How To Get The Sheet Name From Excel in UiPath

Excel is the most used application in the business process automation.

To work with it, we might sometimes want to know the sheets available in it, let us see how to find all the sheet names available in a workbook.

wb as WorkbookApplication
wb.GetSheets

Example

Implementation using UiPath :

Let us implement a workflow which takes a sample excel file and displays all the sheets available in it.

Step 1:
Drag “Excel Application Scope” activity into the designer panel and supply the following values into the activity’s properties panel

WorkbookPath: “Sample_Excel.xlsx” (String type)
Workbook: myWorkbook (WorkbookApplication type)

image

Uploading: image.png(1)…

Step 2:
Drag “For Each” activity into the designer panel and supply the values to it as shown below.

myWorkbook.GetSheets

Use “ Message Box ” to display the sheets.

image

Step 3:
Now, execute the project!!!

image

Hope it has helped you…

Happy Learning!!!

1 Like