Skip to content

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:

  1. Add a new step.
  2. Select Set a Variable Value from the Action dropdown.
  3. Enter a variable name in the Element Key field (e.g., FinanceSheetNumber). This variable will store the retrieved sheet number.
  4. Click on Form, select Functions, and choose EXCEL Handler Functions from the dropdown.
  5. 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).
  6. Click Save.
Tabular View
Card View

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}).

Back To Top