Skip to content

Get Excel Sheet Color Function: getSheetColor

The Get Excel Sheet Color function retrieves the background color of a specified sheet in an Excel file. This function is useful for identifying color-coded sheets in automation workflows.

Note: Ensure that the file being used is not open during the execution of the Case to avoid errors or conflicts.

Example: Suppose you have an Excel file named Report.xlsx located in C:\Data, and you need to extract the background color of the sheet named Summary.

scrn-excel-sheet-sample
Sample Excel

Steps to Configure:

  1. Add a new step.
  2. Select Set a Variable Value from the Action dropdown.
  3. Enter a variable name in Element Key (e.g., SheetColor). This variable will store the extracted sheet color.
  4. Click Form, select Functions, and choose Get Excel Sheet Color.
  5. Provide the following parameters:
    • FPath: Enter the full path of the Excel file (e.g., C:\Data\Report.xlsx).
    • SheetName: The name of the sheet from which to retrieve the color (e.g., Summary).
    • ColorFormat: Select the format in which you want to retrieve the color:
      • RGB
      • ARGB
      • Hex
      • Name
  6. Click Save.

Note: While the steps for adding an Action are identical in both views, the display of the steps changes:

scrn-get-sheet-color-tabular-view
Tabular View
scrn-get-sheet-color-card-view
Card View

Expected Outcome on Execution:

  • The background color of the specified sheet is extracted and stored in the variable SheetColor.
  • You can use this variable in automation using the syntax ${SheetColor}.

Back To Top