GetWorkbookSheets

Estimated reading: 2 minutes 1651 views

This activity helps the user to retrieve all the list of sheets available in the Excel workbook. It functions within the “Excel Scope” activity. 

Properties 

MISC

DisplayName: Displays the name of the activity. The activity name can be customized, which aids in troubleshooting.

SkipOnErrorSpecify the “Boolean” value as “True” or “False.”
True: Continue executing the workflow regardless of any errors thrown.
False: Halt the workflow if it encounters any errors.
None: If the option is left blank, the activity will, by default, behave as if “False” were chosen.

Version: It indicates the version of the feature being used.

Output

Result: This parameter allows you to view the execution status of the activity and returns a value in “Boolean.”
True: Indicates that the activity has been executed successfully without any errors.
False: Indicates that the activity has been unsuccessful due to an unexpected error being thrown.

Sheets: This parameter retrieves the list of sheets from the specified workbook and returns the values in “List of String” data type.

Example

In the following example, I am using a sample excel sheet to retrieve the list of sheets. 

Click here to get the sample excel file. 

Steps to execute the bot:

1. Open an existing solution. 
2. Drag and drop the “ExcelScope” activity into the workflow. 
3. Double click on the activity and choose the input excel file attached. 
4. Now, place the “GetWorkbookSheets” activity inside the body of excel scope activity. 
a. Navigate to the “Sheets” in the output section of the “GetWorkbookSheets” to create a variable. 
b. Here, the variable is created as “List_Sheets” by pressing “CTRL +Q”.  
5. Next, place the “ForEach” next to the “GetWorkbookSheets”. 
a. Choose the “TypeArgument” as “String” since we are iterating and retrieving the list of string values. 
b. Provide the values as “List_ Sheets”. 
c. Add a “Writelog” activity into the body of “ForEach” activity and provide the input as “item”. 
6. Now, save and execute the workflow. 

Share this Doc

GetWorkbookSheets

Or copy link

CONTENTS