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

ID: Q120796

The information in this article applies to:

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

Last Reviewed: February 4, 1998