7.1 The object model

The object model

Like Word, Excel s top-level object is the Application object, which has properties and methods that relate to Excel as whole. A number, like StartupPath, Version, and WindowState, are the same, while others, like Calculation, which determines when calculations occur, are specific to Excel. The Application object also provides access to all other objects in Excel.

The fundamental object in Excel is a Workbook. This corresponds to an XLS file. The Excel Application object keeps track of all its open workbooks in a Workbooks collection, and uses the ActiveWorkbook property to return a reference to the active Workbook object.

Each Workbook has two main collections, Worksheets and Charts, which represent the pages of the workbook and the graphs it contains, respectively. Workbook has ActiveSheet and ActiveChart properties containing references to the current Worksheet and Chart objects. Excel also provides a shortcut by offering ActiveSheet, ActiveChart, and ActiveCell properties at the Application level.

As with Word, the Excel Visual Basic Help file contains a live diagram of the object model. Figure 1 shows the portion of the object model diagram that describes the Worksheet object.

 

Copyright 2000 by Tamar E. Granor and Della Martin All Rights Reserved



Microsoft Office Automation with Visual FoxPro
Microsoft Office Automation with Visual FoxPro
ISBN: 0965509303
EAN: 2147483647
Year: 2000
Pages: 128

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net