Macro Modules
Macro Module
If a report requires additional processing in Excel, you can instruct phiReport to run your custom VBA function once the report generation is complete.
Macro Source
phiReport supports 2 types of VBA Macro injection methods.
Excel Macro File
In this mode, the VBA Macro is created and saved as an Excel file. Supported Excel formats are XLS, XLSX and XLSM. To run the macro, phiReport downloads the Excel file to the local workstation and executes the function defined in "Function to Execute".
Create your VBA source in Excel and use all the debugging tools available from within Excel. Once debugged the VBA source is saved in an Excel worksheet. Place the Excel worksheet where it can be accessible by all your users. In an intranet environment, you can place it on a shared network folder. In an internet environment, you can place it on a web server. The Excel file is copied or downloaded everytime phiReport needs to run your macro.
VBA Modules Item
In this mode, the VBA Macro is stored in a Pick file VBA.Modules. To run the macro, phiReport "injects" the VBA source to the Excel worksheet then executes the macro.
To create the VBA source you need to use Excel VBA editor/debugger then copy the source and paste it into a Pick item in VBA.Modules. Once in Pick it becomes part of the database. A database backup will save all your VBA source. There's no special consideration for deployment since everything is "injected" directly from Pick to your workstation.
Security Consideration
By default, Excel disables all macros with notification. This means that everytime you try to run a macro, Excel will prompt the user with a warning message and will not run the macro. Since phiReport relies heavily on Excel VBA macros, the minimum required setting is "Disable all macros except digitally signed macros". This means that the first time a phiReport macro is run, Excel will display the 3phi Solutions security certificate to identify itself as "safe to run". Once the signature is approved, Excel will no longer ask for approval unless the certificate has expired. All VBA macros produced by 3phi Solutions are signed.
When using the Excel Macro file, you need at a minimum "Disable all macros except digitally signed macros" and sign all you custom VBA modules. A VBA Digital signature must be purchased through an online security provider, free certificate are also available online.
When using the VBA Modules method, you need to "Enable all macros" and also "Trust access to the VBA project object model" since the injection requires access to the project object model.
Macro Name
Name of the Excel worksheet of the VBA.Module item to "inject"
Function to Execute
Name of the VBA macro to execute. The function must be a VBA FUNCTION and not a SUB.
Function Parameters (for future use)
Function parameters to pass to the VBA Function