Microsoft KB Archive/120796

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

Article ID: 120796

Article Last Modified on 8/15/2005

-

APPLIES TO


 * Microsoft Excel 95 Standard Edition
 * Microsoft Excel 5.0c
 * Microsoft Excel 5.0 for Macintosh

-



This article was previously published under Q120796



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:  Select any Microsoft Excel version 4.0 Macro sheet or worksheet in the workbook that you want to save as an add-in file. On the Insert menu, click Name, and then click Define. 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. 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.

