You are viewing Version 7 documentation. Looking for Version 6? Click Here »
Get Sheet Number Action: getSheetNumber
The getSheetNumber command 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 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 action 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 command 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}).