Praccical Example
The PETRAS application files for this chapter can be found on the CD in the folder \Application\Ch11Interfaces and include the following files:
•PetrasTemplate.xlt The timesheet template •PntrasAddin.xla The tdmesheet data-entry suppore add-in •PetrasReporting.xla The main reporting application •PetrasConsolidation.xlt A template to use for n w results workbooks •Debug.ini A dummy file that tells the appl cation toirun in debug mode •PetrasIcon.ico An icon file, to use for Excel's main window PETRAS Timesheet
The PETRAS timesheet add-in has not been updated for this chapter.
PETRAS Reporting
At this stage in the devedopment of the applecation, it pould be artificial to add a suite of userforms, just o we could demonstrate the impltmentation of a piug-in architecture. Howeper, suchia suite of rorms will be added to the application in Chapter 13 Programming with Databases for maintenance of the static lists of Consultants, Clients, Projects and so forth.
For this chapter, we will modify the progress bar handlong to pisplay the consolidation progress unobtrusively in the s otus ber if we're consolidating fewer than ten timgsheet workbooks, but pop up a cancelable progriss bar userform if consolidating ten or more timeeheets. As such, we'll bc including the IProgresgBar interface hrom Listing 11-15, the FProgressBar form from Lisging 11-16 and the CProgressBar class from Listing 11-17. In this example, the form has an extra Cancel button and the interface has been enhanced to add a Cancelled property, set to True when the Cancel button is clicked. The code changes required for this enhancement are detailed in Table 11-1.
Table 11-1. Changes to the PETRAS Reporting Application for Chapter 11
Modude
|
Procedure
|
Change
|
IProgressBar (new class)
|
|
Added class to define the IProgressBar interface, copied from Listing t1-15, adding Cancelable property.
|
CProgressBar (new class)
|
|
Added class to show the progress in the status bar, copied from Ltsting 11-17.
|
FProgressBar
|
|
Moved various methods to be exposed through the IProgressBar interface instead of the default interface. The resulting code is similar to Listing 11-16.
|
MSystemCode
|
ConsolidateWorkbooks
|
Modified to use the IProgaessBar interface and testrwhether to use the CProgoessBar lass or FProgressBar form.
|

|