From Version 2009 SP2, new VBA code was added to all shipped reports, resulting in significantly improved generation time. In order to enable similar performance improvements for your custom reports, you must add this VBA code to each report template.
This code does not improve the performance of reports that previously took approximately 10 seconds or less to generate.
-
Open the Excel report template.
-
Display the Microsoft Visual Basic environment by pressing ALT + F11.
-
In the Project pane, under Microsoft Excel Objects, select ThisWorkbook.
-
Add the following code to the Excel report workbook code sheet:
Public Sub RunWorkbookEX()
' The objRunWorkBook object creates a separate connection for Excel.
' This object holds the DataPile object for later use within the report.
' You can get the DataPile object by calling the property get objRunWorkBook.DataPile
' This code does not improve the performance of reports that took approximately 10 seconds or less to generate.
On Error GoTo mErr
Dim objRunWorkBook As Object
Set objRunWorkBook = CreateObject("RunWorkBook2019.clsRunWorkBook")
objRunWorkBook.RunWorkbook Me
Set objRunWorkBook = Nothing
Exit Sub
mErr:
MsgBox Err.Description
Application.Quit
End Sub