Excel Activities
Automate Microsoft Excel workbooks using the COM interop engine. All Excel activities must be placed inside an Excel Application Container, which opens the workbook and maintains the COM session for the duration of the container. 18 activities cover reading, writing, sheet management, formatting, formulas, filters, sorting, macros, and VBA.
Excel Application Container
Opens an Excel workbook via COM (or creates it if missing) and provides the Excel session context to all child activities. Saves and closes the workbook on exit by default.
| Parameter | Type | Default | Description |
|---|---|---|---|
| FilePath | String | — | Absolute path to the .xlsx / .xlsm / .xlsb workbook |
| Visible | Boolean | false | Show the Excel window during automation |
| ReadOnly | Boolean | false | Open the workbook in read-only mode |
| CreateIfMissing | Boolean | false | Create the workbook file if it does not exist |
| SaveOnComplete | Boolean | true | Save the workbook when the container exits |
| CloseAfterCompletion | Boolean | true | Close the Excel instance after the container exits |
| MacroPolicy | FollowSystem | PreferEnable | PreferDisable | FollowSystem | Macro trust level when opening .xlsm files |
| Body | Activity sequence | — | Excel child activities to run in scope |
| 1 | Excel Application Container FilePath="C:\Reports\sales.xlsx" Visible=false |
| 2 | Body: |
| 3 | Excel Read Range SheetName="Sheet1" Range="A1:D100" OutputVariable="salesData" |
| 4 | For Each Row DataVariable="${salesData}" RowVariable="row" |
| 5 | Body: |
| 6 | ... |
Excel Read Range
Reads a cell range into a DataTable variable.
| Parameter | Type | Required | Description |
|---|---|---|---|
| SheetName | String | No | Sheet to read from (defaults to the active sheet) |
| Range | String | No | A1 notation range (e.g., A1:D100). Leave empty to read the entire used range. |
| HasHeaders | Boolean | No (default: true) | Treat the first row as column names |
| OutputVariable | String | Yes | Variable to store the resulting DataTable |
Excel Write Range
Writes a DataTable into the workbook starting at a specified cell.
| Parameter | Type | Required | Description |
|---|---|---|---|
| DataVariable | String | Yes | DataTable variable to write |
| SheetName | String | No | Target sheet (defaults to active sheet) |
| StartCell | String | No (default: A1) | Top-left cell to begin writing |
| WriteHeaders | Boolean | No (default: true) | Write column names in the first row |
Excel Get Cell Value
Reads the value of a single cell.
| Parameter | Type | Required | Description |
|---|---|---|---|
| SheetName | String | No | Sheet name |
| Cell | String | Yes | Cell address, e.g. B5 |
| OutputVariable | String | Yes | Variable to store the cell value |
Excel Set Cell Value
Sets the value of a single cell.
| Parameter | Type | Required | Description |
|---|---|---|---|
| SheetName | String | No | Sheet name |
| Cell | String | Yes | Cell address |
| Value | String | Yes | Value to write (supports variable references) |
Excel Get Sheet Names
Returns all sheet names in the workbook as a StringArray variable.
| Parameter | Type | Required | Description |
|---|---|---|---|
| OutputVariable | String | Yes | Variable to store the list of sheet names |
Excel Add Sheet
Adds a new worksheet to the workbook.
| Parameter | Type | Required | Description |
|---|---|---|---|
| SheetName | String | Yes | Name for the new sheet |
Excel Delete Sheet
Permanently deletes a worksheet. Cannot be undone.
| Parameter | Type | Required | Description |
|---|---|---|---|
| SheetName | String | Yes | Name of the sheet to delete |
Excel Rename Sheet
Renames an existing worksheet.
| Parameter | Type | Required | Description |
|---|---|---|---|
| OldName | String | Yes | Current sheet name |
| NewName | String | Yes | New sheet name |
Excel Save Workbook
Saves the workbook explicitly mid-container. Useful for checkpointing long operations.
| Parameter | Type | Required | Description |
|---|---|---|---|
| SavePath | String | No | Save-as path (saves in-place if omitted) |
Excel Set Formula
Writes a formula string into a cell.
| Parameter | Type | Required | Description |
|---|---|---|---|
| SheetName | String | No | Sheet name |
| Cell | String | Yes | Cell address |
| Formula | String | Yes | Excel formula, e.g. =SUM(A1:A10) |
Excel Get Formula
Reads the formula string stored in a cell.
| Parameter | Type | Required | Description |
|---|---|---|---|
| SheetName | String | No | Sheet name |
| Cell | String | Yes | Cell address |
| OutputVariable | String | Yes | Variable to store the formula string |
Excel Format Range
Applies visual formatting to a cell range.
| Parameter | Type | Required | Description |
|---|---|---|---|
| SheetName | String | No | Sheet name |
| Range | String | Yes | A1 notation range, e.g. A1:D10 |
| Bold | Boolean | No | Make text bold |
| Italic | Boolean | No | Make text italic |
| FontSize | Number | No | Font size in points |
| FontColor | String (hex) | No | Font colour, e.g. #FF0000 |
| BackgroundColor | String (hex) | No | Cell background colour |
| NumberFormat | String | No | Number format string, e.g. #,##0.00 |
Excel Auto Filter
Applies an AutoFilter to a range. Optionally filter to show only rows matching a criterion.
| Parameter | Type | Required | Description |
|---|---|---|---|
| SheetName | String | No | Sheet name |
| Range | String | Yes | Range to apply AutoFilter on |
| Column | Int32 | No (default: 1) | 1-based column index to apply filter criteria on |
| Criteria | String | No | Filter value — leave empty to just enable the filter dropdowns |
Excel Sort Range
Sorts a range by a column.
| Parameter | Type | Required | Description |
|---|---|---|---|
| SheetName | String | No | Sheet name |
| Range | String | Yes | Range to sort |
| SortByColumn | String | Yes | Column letter to sort by (e.g., B) |
| Ascending | Boolean | No (default: true) | Sort direction |
Excel Run Macro
Executes a named VBA macro already present in the workbook.
| Parameter | Type | Required | Description |
|---|---|---|---|
| MacroName | String | Yes | Name of the macro to run |
| Arguments | String | No | Comma-separated arguments to pass to the macro |
| OutputVariable | String | No | Variable to store the macro return value |
Excel Execute VBA
Injects and executes custom VBA code at runtime — no pre-existing macro required.
| Parameter | Type | Required | Description |
|---|---|---|---|
| VBACode | String | Yes | VBA source code to inject into the workbook |
| EntryPoint | String | Yes | Subroutine or function name to call after injection |
| OutputVariable | String | No | Variable to store the return value |
MacroPolicy: PreferEnable on the Excel Application Container when using these activities.