VBA Macros

Note: This feature requires the OfficeReports Analytics Pro or Automation version.

Tables in Excel

OfficeReports enables the user to define advanced tables and charts. You can customize the Table and chart content and layout by specifying a VBA macro name in the Table or Chart Layout definition. Every time the table is calculated, the macro will be called automatically.

You can add your own macros to "C:\Users\Public\OfficeReports\template\XLSMacros.xlam" (Note: When using raw data (NOT recommended) in PowerPoint the macro file is named: PPMacros.pptm)

Note: If your Layout Database is saved in a shared folder, then the template files are saved there as well!

 

The macros used in OfficeReports have to take a workbook as parameter, and have to return a string. Use the workbook parameter to get the sheets and the chart to work with. Do NOT use ActiveSheet and ActiveChart! The string returned should be an error message, or "OK" if there is no problem:

Function MyMacro(wb As Workbook) as String
  'Declarations
  On Error GoTo ErrHandler:
  'Code
  MyMacro = "OK"
  Exit Function
ErrHandler:
  MyMacro = "MyMacro Macro Failed: " & Err.Description
End Function
 

Please have a look at the macros in module "template" in the macro file. Your macros need to have the exact same parameters and return a string!

Layout only available for: A specific chart style might be only relevant for frequencies or crosstab charts. Select in which context a type should be available.

Tables and Charts in PowerPoint

OfficeReports Automation enables the user to define advanced tables and charts. You can customize the Table and chart content and layout by specifying a VBA Macro in the 'Link' definition. Every time the link is updated, OfficeReports will run the macro.

You can add your own macros to "C:\Users\Public\OfficeReports\templatePPLinkMethods.pptm". Note: If your Layout Database is saved in a shared folder, then the template files are saved there as well!

Please have a look at the macros in module "template" in the macro file. Your macros need to have the exact same parameters and return a string!