Get Sheet Number Action: getSheetNumber
The getSheetNumber action retrieves the sheet number corresponding to the specified sheet name or verifies the existence of a sheet by its number. This is helpful when working with multi-sheet Excel files and identifying specific sheets dynamically.
Note: Ensure that the file being used is not open during the Case execution to avoid errors or conflicts.
Example: You have an Excel file departmentData.xlsx with multiple sheets. You want to find the sheet number of a sheet named Finance.
Steps to Configure:
- Add a new step.
- Select Set a Variable Value from the Action dropdown.
- Enter a variable name in the Element Key field (e.g., FinanceSheetNumber). This variable will store the retrieved sheet number.
- Click on Form, select Functions, and choose EXCEL Handler Functions from the dropdown.
- In the Cmd field, select getSheetNumber and provide the following parameters:
- FPath: Specify the path to the Excel file (e.g., C:\CorporateFiles\departmentData.xlsx).
- Sheet: Enter the name or number of the sheet to be located (e.g., Finance or 2).
- Click Save.


Outcome on execution:
- The action identifies the sheet number of Finance in the provided file.
- This sheet number is stored in the variable defined in the Element Key field for use in subsequent steps.
- This variable can be referenced in subsequent steps of the automation process using the syntax ${VariableName} (e.g., ${FinanceSheetNumber}).