Guidelines for Creating a Post-Processing Script

When writing a post-processing script, consider the following guidelines:

  • Your post-processing script must contain a sub-procedure named QC_PostProcessing. This procedure serves as the entry point to your script. This procedure cannot return a value and cannot take any arguments.

  • Before you can work with the report data in Excel, you must first define the range containing the report data. You define this range in two steps:

    • You first define the worksheet containing the report data by creating a worksheet object containing the data. For example, if the worksheet is named Query1, you can use the statement Set MainWorksheet = ActiveWorkbook.Worksheets("Query1").

    • After you define the worksheet containing the report data, you define the range containing the data by creating a range object containing the data. For example, if you defined the worksheet object with name MainWorksheet, you can use the statement Set DataRange = MainWorksheet.UsedRange.

    • After you define this range, you can manipulate the data contained in it using Visual Basic code.

  • Before you run a post-processing script, you must configure your Microsoft Excel security settings so that Excel can run the script.

    Office 2010: In Excel, click the Microsoft Office Button, and then click Excel Options. Select Trust Center > Trust Center Settings > Macro Settings. Select Trust access to the VBA project object model. Close Excel.

    Caution: Enabling macros in Excel allows access to core Microsoft Visual Basic objects, methods and properties, and represents a potential security hazard.

Parent topic: Excel Reports Overview