Microsoft KB Archive/142121

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

PSS ID Number: 142121

Article Last Modified on 10/23/2000

-

The information in this article applies to:


 * Microsoft Excel for Windows 95 7.0

-



This article was previously published under Q142121





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.

