A.11. Chapter 11
A standard library can be added using Tools
References. You can then work with the objects of that library from within your code and have full access to the available properties, methods, and events as you type your code. An external library is more complicated to work with and requires an explicit declaration in the General Declarations section, as well as a procedure call from within your VBA code. External libraries must be declared with the exact syntax, or an error will occur.Automation allows one application to control another application, such as Access controlling Word. You can use automation to create new Excel spreadsheets, to create new Word documents, or to manipulate Outlook objects such as e-mails, contacts, and calendar entries. These are just a few examples of using automation. In order to use automation, you must add a reference to the library that corresponds to the application you want to control.
A code library can be created by simply creating a new Access database that contains the code you want to have reused by other applications. Code libraries are a good idea for storing generic code that multiple applications might want to take advantage of, such as error-handling routines. Instead of copying the same procedures into every application and then having to update multiple locations, you can simply point each application to a single Access ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access