What is meant by the term "object model?"

The power of Visual Basic in general, and of STATISTICA Visual Basic in particular, derives from its ability to access the features of various programs that support the Visual Basic language. For example, you can write a program that produces a results spreadsheet via STATISTICA and pastes that spreadsheet into a Microsoft Word document and a Microsoft Excel spreadsheet. That same program can then access individual cells in the spreadsheet, either in Microsoft Excel or STATISTICA, format those cells so that the contents of some cells are displayed in a different color (e.g., significant results are shown in yellow), and save all results (the document, spreadsheet, and Excel spreadsheet) to a disk. In this case you would access from a single Visual Basic program features in three different applications: STATISTICA, Microsoft Word, and Microsoft Excel.

The way this is generally accomplished is by organizing the respective features and functions available in an application by objects. For example, the STATISTICA application is an object of type Application; this application contains various properties and methods; see also What are properties, what are methods?.

For example, a property of a STATISTICA application is whether or not it is visible on the screen (property Application.Visible = True or Application.Visible = False). Another property of the application object is the currently active analysis (Application.ActiveAnalysis) or active dataset (Application.ActiveDataSet). There are also methods available that perform various operations on the object or inside the object. For example, the Application object contains a method to open a datafile (input spreadsheet).

Some of the properties are themselves different types of objects, with many properties, methods, and other objects. For example, the ActiveDataSet property can be assigned to an object of type Spreadsheet. The Spreadsheet object has many properties itself; among them is the Range property, which can be assigned to an object of type Range. The Range object has many properties, among them the Font property. The Font property can be assigned to an object of type Font, which has properties like Name (of the font), Bold, Italic, etc. So, by setting, for example, the Bold property of the Font object to True, you can format to bold type the contents of a cell range in a spreadsheet in a STATISTICA application.

In general, objects are hierarchically organized, and when you want to access a particular feature of the program (e.g., change the font in a spreadsheet cell), you need to access the proper object by "stepping" through the hierarchy of objects (e.g., from the STATISTICA Application, to the Spreadsheet, to the Range object, to the Font object). So part of learning to program in (STATISTICA) Visual Basic is to gain a good working knowledge of the hierarchical object model. Fortunately, the objects in STATISTICA Visual Basic are logically organized, and can be reviewed via the Object Browser.

The Object Browser (shown below) is displayed by clicking the Object Browser button (on the Macro toolbar) or by selecting Object Browser from the View menu.

For an illustration of how to "navigate" the hierarchy of objects, see the example in How can I change the font (or other aspects) of numbers in spreadsheets?.