Site icon ExcelCult

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)

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.

Step 3:
Now, execute the project!!!

Click here to download the Source Code…

Hope it has helped you…