Home > Features > Advanced Features > Macros

Macros

ReportsDNA provides two opportunities to run custom macros during the creation of each report.

Pre-run Macro

This macro will be run BEFORE the data for the report is loaded.


Post-run Macro

This macro will be run AFTER the data for the report is loaded.





Specifying the macro to call
  • Enter the name of the file containing the macro surrounded by single quotation marks.
  • Follow the path with the exclamation mark character
  • Follow the exclamation mark with the name of the macro

'FILENAME'!MACRO


Shortcuts
The following shortcuts may be taken
  • If the filename is not specified then the macro will be expected to be in the workbook containing the report
  • Use the Variable 'File.xls' to explicitly indicate that the macro is in This File (the file containing the report)
  • The filename can be relative to the file containing the report.

EXAMPLES

Download

Download macrootherbook.xls

Example Macro  
Description
prerunMacro

Calls the macro named prerunMacro in the report's workbook     

&[THISFILEMACRO]postrunMacro
Calls the macro named postrunMacro in the report's workbook    
'macrootherbook.xls'!otherMacro Calls the macro named otherMacro in the workbook named macrootherbook.xls, which
is in the same directory as the report's workbook
'c:\mymacros.xls'!otherMacro  Calls the macro named otherMacro in the workbook located at c:\mymacros.xls,



See also