The Main Procedure

For this application, execution will start in a main procedure that will then call the various other procedures, which will extract data from the database and insert it into the three individual worksheets. The job of this main procedure is only to open a connection to the database file, call the other procedures, then destroy the database connection and exit. For lack of imagination I called this procedure main, and its code is shown in Listing 25.1 (which also includes the project's module-level code). Note that this procedure and all the project's other code should be placed in the ThisWorkbook module of the Excel workbook that we created earlier in the chapter.

Automatic Macro Execution

To have a macro procedure such as ...

Get Office® XP Development with VBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.