XL: What You Need to Know Before You Make an Add-In

ID: Q142121


The information in this article applies to:


SUMMARY

Several considerations must be made in Visual Basic for Applications before you save a project as an add-in (*.xla). An add-in is a fully compiled version of a Microsoft Excel workbook, and in many instances an add-in serves as an appropriate vehicle for distributing Microsoft Excel applications.


MORE INFORMATION

Before you create an add-in, do the following to the workbook that you are going to use to create it:

  1. Remove any unused or extraneous worksheets, module sheets, dialog sheets, charts, and chart sheets.


  2. In macros in the workbook, avoid references to "ActiveWorkbook" when you want to refer to the workbook that contains the macro. ActiveWorkbook refers to whichever workbook is active. Use "ThisWorkbook" to refer to the workbook in which the VB module resides. An add-in can never be active; although it can be loaded into memory, it remains hidden from view.


  3. Because add-ins cannot be edited, it is very important to keep a copy of your original workbook so that you can update procedures or create new procedures.


  4. Certain problems arise when you save a Visual Basic for Applications project with a reference to an add-in. For example, Microsoft Excel "hard codes" the path of the .xla file when the reference is established and the file that contains the reference is saved. The relevant add-in must be saved either in the same directory (or folder) as the Microsoft Excel file that contains the reference or in a directory in the established path on your computer.



REFERENCES

Microsoft Excel Visual Basic User's Guide, Chapter 13: 'Creating Automatic Procedures and Add-in Applications'

Microsoft Press: "Developing Microsoft Excel 95 Solutions"
Microsoft Press: "Developing Microsoft Excel 5 Solutions"

Additional query words:


Keywords          : 
Version           : 7.00
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: April 22, 1999