Declaring an Object Variable to Reference Your Application
Automation requires that you create object variables that reference application objects. After you create an object variable, you can query and change the object's properties as well as execute its methods.You can learn about an object's properties and methods using its object libraries. An object library contains a listing of all the properties and methods that an object exposes. To be able to view foreign objects from within Access, you must first establish a reference to that application. After a reference is established, you can view that object's properties and methods using the Object Browser. You can also view any modules and classes that the parent object exposes.To register an object, the Visual Basic Editor (VBE) must be active. With the code window active, choose Tools, References. The References dialog box appears, as shown in Figure 22.1.
Figure 22.1. The References dialog box.

Each time you install a program, the Windows registry is updated. The References dialog box shows you all the objects registered in Windows (see Chapter 8, "Objects, Properties, Methods, and Events Explained," to access the Object Browser, you can choose View, Object Browser, press F2, or click the Object Browser tool while in the Module window. Notice that in Figure 22.3, the Object Browser displays all the classes that belong to the Excel 11.0 object library. The Range class is selected. All the members of the Range class are displayed in the list box at the right.
Figure 22.2. Registered automation server objects.

Figure 22.3. The Object Browser.
