The Sheets Collection

Within a Workbook object, there is a Sheets collection whose members can be either Worksheet objects or Chart objects. For compatibility with older versions of Excel, they can also be DialogSheets, Excel4MacroSheets, and Excel4InternationalMacroSheets. Excel 5 and Excel 95 included modules as part of the Sheets collection, but since Excel 97, modules have moved to the VBE.

Modules in workbooks created under Excel 5 or Excel 95 are considered by later versions of Excel to belong to a hidden Modules collection and can still be manipulated by the code originally set up in the older versions.

Worksheet and Chart objects also belong to their own collections — the Worksheets collection and the Charts collection, respectively. The Charts collection only includes chart sheets — that is, charts that are embedded in a worksheet are not members of the Charts collection. Charts embedded in worksheets are contained in ChartObject objects, which are members of the ChartObjects collection of the worksheet. See Chapter 9 for more details.

0 0

Post a comment