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

Last reviewed: March 27, 1997
Article ID: Q142121
7.00 WINDOWS kbusage kbhowto

The information in this article applies to:

  • Microsoft Excel for Windows 95, version 7.0

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"


KBCategory: kbusage kbhowto
KBSubcategory:

Additional reference words: 7.00

Keywords : kbhowto kbusage
Version : 7.00
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 27, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.