Microsoft Office 2000/Visual Basic Programmer's Guide |
DLLs make ideal code libraries, because they are small and fast. The disadvantage to using a DLL is that you must make certain it is properly registered on the user's machine.
To create a DLL that acts as a code library
To use the code library from a VBA project, set a reference to the DLL. To set a reference to a DLL, click References on the Tools menu, and use the Browse button to locate the DLL. After the reference has been added, the Object Browser will display information about the procedures in the code library.
If your code library is large, you may not want to load it with your project. Rather than setting a reference to the DLL, you can use the Declare statement to declare references to individual procedures in the DLL.