11.1. Using Dynamic Link Libraries (DLLs)
Dynamic Link Libraries (DLLs) are simply compiled code libraries. You already used a DLL when adding a reference to the ADO library (Chapter 5) so that you could work with the ADO object model and the properties, methods, and events for the objects it contains. In this section, you will look at another example of how to use a standard DLL by just adding a reference in your project. You will also look at how to manually declare an external DLL and use it within your code.
11.1.1. Standard DLLs
You can reference libraries such as DLLs by selecting Tools References from the Visual Basic Editor and then selecting the particular library that you want to work with. After a reference has been added, you can then manipulate the functionality contained in the library from within your VBA code.
Let's look at an example of creating custom command bars for your application using the Microsoft Office 12.0 Object Library. The CommandBars property of the Application object allows you to access the CommandBars collection. The CommandBars collection enables you to manage and create toolbars, menu bars, and shortcut menus.
Create a new database. Select the Office Button New. From the list of available templates, select "Blank Database." Name the database Ch11CodeExamples ...