The Forms Initialize event

Tea397 ly®

The UserForm's Initialize event, which is shown in Example 21-8, is the place to fill the list box with a list of embedded charts. Our application uses a module-level array to hold the chart names, a module-level array to hold the ChartObject object names, and a module-level integer variable to hold the chart count. We fill these variables in the Initialize event and then use the arrays to fill the list. The variables are used again in the main print procedure, which is why we have declared them at the module level.

Note the use of the ReDim statement to redimension the arrays. This is necessary since we do not know at the outset how many embedded charts there are in the workbook.

0 0

Post a comment