Interject Documentation > ReportMacro()
Estimated reading time: 1 minuteFunction Summary
ReportMacro allows a report developer to call VBA macros on Save, Pull, Clear, or Run events. The VBA macro must be a named Sub in the workbook. This function will ignore all errors during the macro’s execution.
Function Arguments
| Parameter Name | Description | Default | Optional |
|---|---|---|---|
| OnPullSaveOrBoth | Events will be triggered on "Pull", "Save," or both. This parameter accepts a string. | NO | |
| OnClearRun OrBoth | Events will be triggered on "Clear", "Run," or both. This parameter accepts a string. | NO | |
| MacroNameToRun | The macro Sub name that will be executed. The placement of this function determines when it is run in comparison to other Report formulas. | NO |
###
Function Composition
| Formula | Example | Explanation |
|---|---|---|
| =ReportMacro( OnPullSaveOrBoth ,OnClearRun OrBoth ,MacroNameToRun ) | =ReportMacro( **"Pull"** , **"Both"** , ** "MyVBAMacro" ** ) | ← The VBA macro will run on the Pull data event. ← The VBA macro will run on both Clear and Run events. ← The VBA macro to run from workbook storage. All errors will be ignored. |
Example from
| From File | Worksheet |
|---|---|
| InterjectBasic |