Invoke VBA

Runs VBA code from a file against a workbook in Microsoft Excel, without adding it to the workbook. Needs Excel with "Trust access to the VBA project object model" on.

Behaviour

Risk: High · Idempotent: No · Safe to retry: No · Recovery: Not replayed after a crash

Package Excel activities Velophex.Excel.Activities 0.7.1-rc.7 · Supported (Core profile) · type id velophex.excel.desktop.invokeVba

Properties#

Input#

Workbook Path#

WorkbookPath · String · Required · Default: Not specified in package metadata

The .xlsx, .xlsm, .xlsb or .xls file. Relative paths resolve against the project folder.

Code File Path#

CodeFilePath · String · Required · Default: Not specified in package metadata

A text file holding VBA procedures (.bas or .txt).

Entry Method#

EntryMethodName · String · Optional · Default: Main

The Sub or Function to call.

Arguments#

Arguments · IReadOnlyList<Object> · Optional · Default: Not specified in package metadata

Values passed to the entry method's parameters, in order (at most 30).

Options#

Save Changes#

SaveChanges · Boolean · Optional · Default: True

Save the workbook after the code; the code itself is never saved in it.

Output#

Result#

Result · Object · Output

The entry Function's return value, or null for a Sub.

Retry and risk#

This activity is not marked safe to retry: if it fails partway, check whether its work already happened before running it again. If a run is interrupted and the outcome of a step is unknown, the step is never retried automatically (what to do). How activities declare this: characteristics, retries and risk.

Every activity also has the engine's common properties: Timeout and Continue On Error.

Generated from Velophex.Excel.Activities 0.7.1-rc.7. Category: Excel Desktop. Keywords: excel, vba, code, invoke, macro, module, desktop, automation.

Properties

Input

Options

Output

Retry and risk

Related activities