Help Centre › Building Processes
This article describes the RPA Excel functionality to get the name of the currently active sheet.
For a full list of available functions, please read EXCEL functions.
Description
The EXCEL Active sheet function returns the name of the currently active (selected) sheet in the workbook. This is useful when you need to store or reference the current sheet name before switching to another sheet.
Setting it up
To use the EXCEL Active sheet function, follow these instructions:
{{popups:rpas/add:action=excel-active-sheet}}
Once on a process map:
- Navigate to the process where you would like to add the EXCEL Active sheet function
- Click on the green button’s drop-down (right side of the green button labelled “Process”)
- On the menu that appears, click on the “+ Activity” item
- From here you can select the EXCEL Active sheet option
- Click "Add" once you are done
Input parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
| File path | Yes | Text | – | Full path to the Excel file. |
| Variable | No | Text | active_sheet | Name of the variable to store the active sheet name in. |
Output variables
| Variable | Type | Description |
|---|---|---|
| active_sheet | String | Name of the currently active sheet. |
Errors
| Error | Description |
|---|---|
| File not found | The specified Excel file could not be found. |
| No active workbook | No workbook is currently open at the specified path. |
Tips
- Use this function to save the current sheet name before switching sheets, so you can return to it later.
- The returned name matches the sheet tab label exactly, including capitalisation and spaces.