Definition and Usage
This command retrieves the formula of a specified cell in an Excel worksheet. It allows you to extract the underlying formula rather than the displayed value, which is useful for automation tasks that need to analyze or manipulate Excel formulas.
Parameter Values
Input parameters
Parameter | Description | Required | Options / Notes |
Excel instance | Please select an Excel instance (created via the "Launch Excel" or "Get active Excel worksheet" command) to identify the instance to operate on. | Yes | Must reference a valid Excel instance |
Worksheet name | Specify the worksheet name (leave blank for the active worksheet) | No | If left blank, the active worksheet will be used |
Row | Specify the row number. Use 1 for the first row, or -1 for the last row | Yes | Positive numbers for specific rows; -1 for the last row |
Column | Specify the column using either a number (1 = first, -1 = last) or a letter (e.g., A, B, C) | Yes | Can use either column letters (A, B, C) or numbers (1, 2, 3) |
Error handling
Parameter Name | Description |
Throw error & stop | When an error occurs, the action will trigger an error and stop the execution of the entire app. |
Retry command | If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process. |
Ignore error & continue | When an error occurs, the action will be ignored, and the workflow will continue without interruption. |
Variables produced
This action produces a string variable that contains the formula from the specified cell. The formula will include the equals sign (=) if the cell contains a formula. If the cell contains a value rather than a formula, the value will be returned as a string.
Using Variables in Conditions
You can use the {x} syntax or the variable icon to insert previously created variables into any of the parameter fields. This is particularly useful when you need to dynamically specify cell locations or worksheet names based on previous operations in your workflow.
Notes
Before using this command, ensure that a valid Excel instance has been created using either the "Launch Excel" or "Get active Excel worksheet" command.
If the specified cell does not contain a formula, the command will return the cell's value as a string.
If the specified cell is empty, an empty string will be returned.
If the specified row or column is out of range, the command will result in an error.
For cells containing array formulas, the command will return the array formula.