Improve the Performance of Custom Reports - Intergraph Smart P&ID - Help - Intergraph

Intergraph Smart P&ID Help

Language
English
Product
Intergraph Smart P&ID
Search by Category
Help
Smart P&ID Version
9 (2019)
Smart Engineering Manager Version
10 (2019)
SmartSketch Version
10.0(2018)

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.

  1. Open the Excel report template.

  2. Display the Microsoft Visual Basic environment by pressing ALT + F11.

  3. In the Project pane, under Microsoft Excel Objects, select ThisWorkbook.

    ExcelWorkbookVBA

  4. 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