uipath Get WorkBook Sheets
时间: 2024-04-08 16:28:35 浏览: 94
To get the sheets in a workbook using UiPath, you can use the following steps:
1. Use the "Excel Application Scope" activity to open the Excel workbook.
2. Inside the scope, add the "Get Workbook Sheets" activity.
3. In the properties of the "Get Workbook Sheets" activity, specify the workbook path or use the output variable from the "Excel Application Scope" activity.
4. Create a variable of type `List<string>` to store the sheet names.
5. Use a For Each loop to iterate through the sheets obtained from the "Get Workbook Sheets" activity.
6. Inside the loop, use the "Add To Collection" activity to add each sheet name to the list variable.
Here is an example of the workflow:
```plaintext
- Excel Application Scope
- Get Workbook Sheets
- Output: sheets (List<string>)
- For Each
- TypeArgument: String
- Values: sheets
- Body
- Add To Collection
- Collection: sheetNames (List<string>)
- Item: currentSheet
```
After executing this workflow, the `sheetNames` variable will contain the names of all the sheets in the workbook.
阅读全文