Properties

The term property is used in the present context in pretty much the same way that it is used in everyday English; it is a trait or attribute or characteristic of an object. For instance, a Worksheet object has 55 properties, among which are Cells, Name, ProtectionMode, and UsedRange. A property's value can be any valid data type, such as Integer, Single, String, or even another object type.

When the value of a property has type Integer, for instance, we will refer to the property as an integer property. Integer properties are quite common, and so Microsoft has defined a large number of built-in enums (152, to be exact, with 1266 individual constants) to give symbolic names to these property values. For instance, the Calculation property of the Application object can take on any of the values in the enum defined by:

Enum XlCalculation xlCalculationManual = -4135 xlCalculationAutomatic = -4105 xlCalculationSemiautomatic = 2 End Enum

If a property's value is an object, it is referred to as an object property. For instance, a Workbook object has an ActiveChart property that returns a Chart object. Of course, the Chart object has its own set of properties and methods.

Because a Chart object can be obtained from a Workbook object, we refer to Chart as a child object of Workbook and Workbook as a parent of Chart. We will have more to say about this parent-child relationship a bit later.

0 0

Post a comment