We are using Jasper Reports API version 4.7.1 in Java. We are trying to attach a Macro to our report with the XLSM extension, however when opening the file the macro is not executed. This is the following line used to attach the macro to our exporter:
Edit: I should mention we are using the JRXlsxExporter class, and exporting to .xlsm type.
The following is the VB script in the Macro that is attached to our report:
Option Explicit Private Sub Workbook_Open() MsgBox "Hello" End Sub
The file opens fine in Excel, and I am able to see the above VB script (ALT + F11), however when I hit on 'Enable Content' after opening the file the Macro code is not ran. In the above case a pop-up window should open with the word "Hello". If we are to attach the code manually in Excel and open the file, it does indeed work, but not when using the Jasper Report API.
Any help to get this to work would be greatly appreciated. Please let me know if theres anything else I can add.