Skip to content

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:

  1. Add a new step.
  2. Select SET 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 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).
  6. Click Save.
v7_excel_file_op_getSheetNumber_list_view
List VIew
v7_excel_file_op_getSheetNumber_grid_view
Grid View

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

Last updated: Oct 7, 2025
Back To Top