To write code that accesses another application, you must instruct VBA to make the objects in the other application available to you. You do this by setting a reference in the other application's object library. This is a file on your computer where all the objects, methods, properties, constants, and events for that application are defined.
You make a reference to an object library through the VBA IDE. In the VBA IDE, under the Tools menu, there is a menu option called References. This menu option will bring up a dialog box that lists all of the object libraries VBA finds on your system. To make a reference to a library, simply select the library from the list. Libraries with check boxes that are selected are already referenced in the current project. For example, to add the Microsoft Excel object library, select the Microsoft Excel object library entry in the list.
Once you have created a reference to another application's object library, you can use the VBA Object Browser to view a list of the application's objects.