22.2. Understanding Excel'S Creatable Objects

Excel exposes various creatable objects, allowing you to reach most of the interesting objects in its object model without explicitly going through the Application object. For most programming purposes, these are the key objects:

  • The Workbooks collection contains the Workbook objects that represent all the open Workbooks. Within a Workbook, the Sheets collection contains the Worksheet objects that represent the worksheets and the Chart objects that represent chart sheets. On a sheet, the Range object gives you access to ranges, which can be anything from an individual cell to a complete worksheet.

  • The ActiveWorkbook object represents the currently active Workbook.

  • The ActiveSheet object represents the active worksheet.

  • The Windows collection contains the Window objects that represent all the open windows.

  • The ActiveWindow object represents the active window. When using this object, be sure to check that the window it represents is the type of window you want to manipulate, as the object returns whatever window currently has the focus.

  • The ActiveCell object represents, you guessed it, the active cell. This object is especially valuable for simple procedures (for example, those that compute values or correct formatting) that work on a cell selected by the user.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.12.184