XL: How to Create a Demand-Loaded Add-in File

Last reviewed: February 2, 1998
Article ID: Q120796

The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0, 5.0a, 5.0c
  • Microsoft Excel for Windows 95, version 7.0
  • Microsoft Excel for the Macintosh, version 5.0

SUMMARY

In Microsoft Excel versions 5.x and 7.0, it is possible to create a "demand-loaded" add-in file. This article describes the method used to create a demand-loaded add-in file.

MORE INFORMATION

A demand-loaded add-in allows you to see the options the add-in provides without actually loading the add-in: when you use one of the functions included with the add-in, the add-in is loaded into memory: demand-loaded add-ins are available in the Function Wizard dialog box even if the add-in itself has not been loaded into memory.

To make a demand-loaded add-in file, follow these steps:

  1. Select any Microsoft Excel version 4.0 Macro sheet or worksheet in the workbook that you want to save as an add-in file.

  2. On the Insert menu, click Name, and then click Define.

  3. In the Define Name dialog box, enter the following values:

          Names in Workbook edit box : __DemandLoad
    

          Refers to edit box         : =TRUE
    
       Note that the word "DemandLoad" is preceded by *two* underscore
       characters.
    
    

  4. Click OK.

When you make the workbook into an add-in, by choosing Make Add-In from the Tools menu, and you then use the Add-Ins dialog box to add the file to Microsoft Excel, the add-in will not actually be loaded until you use or recalculate one of the functions, macros, or subroutines defined in the add-in.

When you use the Add-Ins dialog box to add a demand-loaded add-in to Microsoft Excel, a line similar to the following will be added to your EXCEL5.INI file (if you are using Microsoft Excel for Windows):

   OPEN7=/F C:\EXCEL\MYADDIN.XLA

In Microsoft Excel for Windows 95, an entry will be added to your system's registry; in Microsoft Excel for the Macintosh, a change is made to your "Excel Settings (5)" file.

The /F switch signifies to Microsoft Excel that the add-in in question is a demand-loaded add-in. Microsoft Excel will not yet open the add-in file, but it will read the available functions from the add-in and make them available in the Function Wizard dialog box.

In Microsoft Excel for the Macintosh, the "Excel Settings (5)" file is stored in a binary format and can only be read or edited by the Microsoft Excel program.

REFERENCES

"Microsoft Excel Developer's Kit," version 5.0, page 382


Additional query words: 5.00 5.00c 7.00
Version : WINDOWS:5.0,5.0c,7.0; MACINTOSH:5.0
Platform : MACINTOSH 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: February 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.