Microsoft Office 2000/Visual Basic Programmer's Guide |
In the previous and current versions of Word, Excel, Access, and PowerPoint, you can use VBA to create add-ins specific to each of those applications. For example, you can create an add-in for Word that builds a custom report from a selected database, and another add-in for Excel that performs a similar task. You save the Word add-in as a Word template file (*.dot), and the Excel add-in as an Excel add-in file (*.xla). Despite the fact that the two add-ins share some common code, you have to create two separate add-ins in order to add functionality to both applications.
Note Outlook and FrontPage do not provide any way to create application-specific add-ins by using VBA.
A COM add-in, on the other hand, can share some add-in functionality and code across applications. The COM add-in project contains a component for each application in which it will run and is also registered for each application. Usually a COM add-in contains some code that is common across all applications and some that is specific to each application. For example, if you build a COM add-in to create a custom report in Word or Excel from a database, the code that accesses the database and retrieves a set of data can be shared. Once you've retrieved the data, you need to work with the Word object model to write the data to Word, and with the Excel object model to write the data to Excel.
The following table lists both types of add-ins and their file extensions.
Add-ins | File extensions | Available to |
Word add-ins (application-specific) | .dot, .wll, .wiz | Word only |
Excel add-ins (application-specific) | .xla, .xll | Excel only |
PowerPoint add-ins (application-specific) | .ppa, .pwz | PowerPoint only |
Access add-ins (application-specific) | .mda, .mde | Access only |
Exchange Client extensions (application-specific) | .dll | Outlook and Microsoft Exchange clients only |
COM add-ins | .dll | Word, Excel, Access, PowerPoint, Outlook, and FrontPage |
Note Prior to Visual Basic 4.0, DLLs could not be created in Visual Basic. Developers used Visual C++ or a comparable language to create DLLs. The .wll and .xll add-in file formats refer to DLLs created in C++ specifically as add-ins for Word and Excel, before these applications included VBA. Likewise, the only add-ins available for the previous version of Microsoft Outlook were Exchange Client extensions, which are DLLs created only in C/C++. Although more recent versions of Word, Excel, and Outlook still support these custom add-ins, you no longer need to create .wll and .xll files or Exchange Client extensions in order to build a sophisticated add-in.
COM add-ins and application-specific add-ins also differ in terms of how the user views and installs available add-ins. In all Office 2000 applications, available COM add-ins are displayed in the COM Add-ins dialog box. This dialog box is the same across all Office applications.