Set References Excel VBA

To set references Excel VBA, from the Tools menu in the VBA IDE (editor), choose References. Scroll through the list and choose what you want or need.

Tools > References

When you are writing a program in Excel in VBA, for example, you may want to accomplish certain tasks that are not within the Excel Object Module. Such as opening a Word document from Excel (Microsoft Word 11.0 Object Library), access the file system (Microsoft Scripting Runtime), access a database (Microsoft ActiveX Data Objects 2.8 Library), or any other library that is installed on your computer. The list is long.After you add a reference because you know you need it or you are exploring them, you can click on the Object Browser (in the black square below) icon in the toolbar, choose the newly added reference, you can see all the objects available in the library along with all of their properties, methods and types, or you can type an Object name ("Selection" below), property, etc. and see all of its uses by clicking on the binoculars next to it.

Add Reference to Word

Object Browser Word Selection

When you create an Object variable for an Object in the library it will behave just as the library you are inherently working in...

Set the Word Object

That's really all there is to do to set references in excel vba, although, as you can see there are many libraries that you can utilize.

This site is powered by Site Build It!. If you enjoy it, please check out the
Site Build It homepage
 to learn more and on how to build a success-guaranteed site with no technical skills.

Custom Search






Go to the next tutorial: VBA Load Combobox from xls

Return from Set References Excel VBA to Free VBA Tutorials

Return to our Homepage