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)

Get Sheet Names From Excel 1Get Sheet Names From Excel 2

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.

Get Sheet Names From Excel 3

Step 3:
Now, execute the project!!!

Get Sheet Names From Excel 4.PNG

 

Click here to download the Source Code…

Hope it has helped you… 

 

Advertisements

Author: Sharath Raju

Founder@www.ExcelCult.com

Leave a Reply