Excel Activities
Excel activities use a parent-child pattern. Wrap operations inside an Excel Application Container to open a workbook and share an Excel session across all child activities. The container handles Excel lifecycle (open, save, close) so child activities only need to specify the operation and (optionally) sheet name.
Excel Add MacroExcel Add Macro
Embeds a VBA module permanently into the active workbook. The workbook must be macro-enabled (.xlsm). Requires VBA project trust.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ModuleName | String | Yes | — | Name for the VBA module (e.g. 'MyMacros'). This becomes the module name in the VBProject. |
VBACode | String | Yes | — | The VBA source code to embed. Can contain multiple Subs/Functions. Click ⋯ to open the VBA editor. |
Overwrite | Boolean | No | True | If a module with the same name already exists, replace it. Default: true. |
MacroNameOutput | String | No | macroName | Variable name to store the first Sub/Function name found in the VBA code. Use this variable in ExcelRunMacro to call the macro dynamically. |
Excel Add SheetExcel Add Sheet
Adds a new worksheet to the active Excel workbook.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
SheetName | String | Yes | — | The name of the new worksheet to add. |
Excel Application ScopeExcel Application Container
Opens an Excel workbook and provides a session for child activities. Manages performance flags, preflight checks, and cleanup automatically.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
FilePath | String | No | — | Path to the Excel workbook to open. |
Visible | Boolean | No | False | Whether Excel should be visible during automation. |
ReadOnly | Boolean | No | False | Open workbook in read-only mode. |
CreateIfMissing | Boolean | No | False | Create the workbook file if it doesn't exist. |
Password | String | No | — | Password for protected workbooks. |
MacroPolicy | String | No | FollowSystem | How to handle macro security (FollowSystem, PreferEnable, PreferDisable). Allowed: FollowSystem, PreferEnable, PreferDisable |
ValidateTrustedLocation | Boolean | No | False | Verify workbook is in a Trusted Location. |
ValidateVBATrust | Boolean | No | False | Verify VBA project object model access is enabled. |
ValidateMOTW | Boolean | No | False | Verify workbook has no Mark of the Web. |
DisableScreenUpdating | Boolean | No | True | Disable screen updating for performance. |
SetManualCalculation | Boolean | No | True | Set calculation to manual for performance. |
RestoreExcelState | Boolean | No | True | Restore Excel state (screen updating, calculation) after children complete. |
CloseAfterCompletion | Boolean | No | True | Close Excel session after child activities complete. |
SaveOnComplete | Boolean | No | True | Save the workbook before closing. |
Excel Auto FilterExcel Auto Filter
Applies AutoFilter to a range in the active Excel workbook.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
SheetName | String | No | — | The worksheet to filter. If empty, uses the active sheet. |
Range | String | Yes | — | The cell range to apply AutoFilter to (e.g. 'A1:D100'). |
Column | String | No | 1 | The 1-based column index within the range to filter (default: 1). |
Criteria | String | No | — | The filter criteria value. Leave empty to clear the filter. |
Excel Delete SheetExcel Delete Sheet
Deletes a worksheet from the active Excel workbook.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
SheetName | String | Yes | — | The name of the worksheet to delete. |
Excel Execute VBAExcel Execute VBA
Injects and executes VBA code in the active Excel workbook. Requires VBA project trust.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
VBACode | String | Yes | — | The VBA source code to inject (a Sub or Function definition). Click ⋯ to open the VBA editor. |
EntryPoint | String | Yes | — | The name of the Sub or Function to call after injecting the code. |
OutputVariable | String | No | vbaResult | Variable name to store the VBA return value (if any). |
Excel Format RangeExcel Format Range
Applies formatting to a range in the active Excel workbook. Only specified properties are changed.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
SheetName | String | No | — | The worksheet containing the range. If empty, uses the active sheet. |
Range | String | Yes | — | The cell range to format (e.g. 'A1:D10'). |
Bold | String | No | — | Set to 'true' or 'false' to toggle bold. Leave empty to keep existing. |
Italic | String | No | — | Set to 'true' or 'false' to toggle italic. Leave empty to keep existing. |
Underline | String | No | — | Set to 'true' or 'false' to toggle underline. Leave empty to keep existing. |
FontSize | String | No | — | Font size in points (e.g. '12'). Leave empty to keep existing. |
FontColor | String | No | — | Font color as #RRGGBB hex (e.g. '#FF0000') or named color ('red', 'blue'). |
FontName | String | No | — | Font family name (e.g. 'Arial', 'Calibri'). Leave empty to keep existing. |
BackgroundColor | String | No | — | Cell fill color as #RRGGBB hex or named color. |
NumberFormat | String | No | — | Excel number format string (e.g. '#,##0.00', 'dd/MM/yyyy'). |
HorizontalAlignment | String | No | — | Horizontal alignment: 'left', 'center', or 'right'. Allowed: left, center, right |
Excel Get Cell ValueExcel Get Cell Value
Reads the value of a single cell from the active Excel workbook.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
SheetName | String | No | — | The worksheet to read from. If empty, uses the active sheet. |
Cell | String | Yes | — | The cell address to read (e.g. 'A1', 'B2'). |
OutputVariable | String | No | cellValue | Variable name to store the cell value. Defaults to 'cellValue'. |
Excel Get FormulaExcel Get Formula
Gets the formula from a cell in the active Excel workbook.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
SheetName | String | No | — | The worksheet containing the cell. If empty, uses the active sheet. |
Cell | String | Yes | — | The cell address to read the formula from (e.g. 'A1', 'B2'). |
OutputVariable | String | No | cellFormula | Variable name to store the formula string. |
Excel Get Sheet NamesExcel Get Sheet Names
Returns a list of all sheet names in the active Excel workbook.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
OutputVariable | String | No | sheetNames | Variable name to store the list of sheet names. Defaults to 'sheetNames'. |
Excel Read RangeExcel Read Range
Reads a range from an Excel worksheet and stores it as a DataTable variable.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
SheetName | String | No | — | The worksheet to read. If empty, the first sheet (or active sheet in container mode) is used. |
Range | String | No | — | Cell range to read (e.g. 'A1:D10'). If empty, reads the entire used range. |
HasHeaders | Boolean | No | True | If true, the first row is used as column headers. |
FilePath | String | No | — | Path to the Excel file. Only required when used outside an Excel Application Scope. |
OutputVariable | String | No | excelData | Variable name to store the resulting DataTable. Defaults to 'excelData'. |
Excel Rename SheetExcel Rename Sheet
Renames a worksheet in the active Excel workbook.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
OldName | String | Yes | — | The current name of the worksheet. |
NewName | String | Yes | — | The new name for the worksheet. |
Excel Run MacroExcel Run Macro
Runs a named macro (Sub or Function) in the active Excel workbook.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
MacroName | String | Yes | — | The name of the macro to run (e.g. 'Sheet1.MyMacro' or 'MyModule.Calculate'). |
Arguments | String | No | — | Comma-separated positional arguments to pass to the macro. |
OutputVariable | String | No | macroResult | Variable name to store the macro return value (if any). |
Excel Save WorkbookExcel Save Workbook
Saves the active Excel workbook. Optionally saves to a new file path (Save As).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
SaveAsPath | String | No | — | Optional file path to save the workbook to (Save As). If empty, saves in place. |
Excel Set Cell ValueExcel Set Cell Value
Writes a value to a single cell in the active Excel workbook.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
SheetName | String | No | — | The worksheet to write to. If empty, uses the active sheet. |
Cell | String | Yes | — | The cell address to write to (e.g. 'A1', 'B2'). |
Value | String | Yes | — | The value to write. Supports variable references. Numbers and booleans are auto-converted. |
Excel Set FormulaExcel Set Formula
Sets a formula on a cell in the active Excel workbook.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
SheetName | String | No | — | The worksheet containing the cell. If empty, uses the active sheet. |
Cell | String | Yes | — | The cell address to set the formula on (e.g. 'A1', 'B2'). |
Formula | String | Yes | — | The Excel formula to set (e.g. '=SUM(A1:A10)', '=VLOOKUP(B1,Sheet2!A:B,2,FALSE)'). |
Excel Sort RangeExcel Sort Range
Sorts a range by a specified column in the active Excel workbook.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
SheetName | String | No | — | The worksheet containing the range. If empty, uses the active sheet. |
Range | String | Yes | — | The cell range to sort (e.g. 'A1:D100'). |
SortByColumn | String | Yes | — | The column to sort by — a cell address (e.g. 'A1') or column range (e.g. 'B:B'). |
Ascending | String | No | true | Sort order: 'true' for ascending (default), 'false' for descending. |
Excel Write RangeExcel Write Range
Writes a DataTable to an Excel worksheet starting at the specified cell.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
DataTable | DataTable | Yes | — | The variable name containing the DataTable to write. |
SheetName | String | No | Sheet1 | The target sheet name. Defaults to 'Sheet1'. |
StartCell | String | No | A1 | The cell to start writing at (e.g. 'A1'). Defaults to 'A1'. |
WriteHeaders | Boolean | No | True | If true, writes column names as the first row. |
FilePath | String | No | — | Path to the Excel file. Only required when used outside an Excel Application Scope. |