SAMPLE: FRMWRK32.EXE: Updated Generic.xll Template for ExcelLast reviewed: August 15, 1997Article ID: Q152152 |
The information in this article applies to:
SUMMARYThe sample code provided contains a template that can used for writing 32-bit Microsoft Excel XLLs for Windows. This code demonstrates many of the features of the Microsoft Excel C API. This sample was updated from the Microsoft Excel Developer's Kit, version 5. The following file is available for download from the Microsoft Software Library:
~ Frmwrk32.exe (size: 101510 bytes)For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q119591 TITLE : How to Obtain Microsoft Support Files from Online Services MORE INFORMATION
Creating Stand-alone DLLs (XLLs)Microsoft Excel supports stand-alone DLLs. These are DLLs (or code resources) that the user opens by choosing Open from the File menu and selecting a DLL file or by using the Microsoft Excel Add-In Manager. The user can also put DLL files in the Microsoft Excel Startup directory so that they are opened at run time. By convention, stand-alone DLLs are called XLLs. After the DLL is built, the DLL should be given a filename with the extension .XLL. When using an XLL, the user never sees a macro sheet or Add-In sheet. Therefore, an XLL must be able to do everything an XLA (Add-In) can do. In particular, XLLs need a way to provide functions that run automatically at open time, close time, and so on. When developing an XLL, you need to:
The Generic Template for XLLsThe sample code provided contains a template you can use for writing your own 32-bit Microsoft Excel XLLs. This code demonstrates many of the features of the Microsoft Excel C API. To see the generic Add-In code, open GENERIC.C from the sample. When the compiled generic Add-In, GENERIC.XLL, is opened in Microsoft Excel, it creates a new Generic menu with the four Commands listed in the following table:
Command Action ------------------------------------------------------------------- Dialog Displays a Microsoft Excel dialog box Dance Moves the selection around until you press ESC Native Dialog Displays a Windows dialog box that was created using the Windows API Exit Closes GENERIC.XLL and removes the menuThe generic Add-In also provides two functions, Func1 and FuncSum, that can be used whenever the generic Add-In is open. These functions appear in the Generic Add-In category in the Function Wizard. Also, these functions can be registered without loading all of the generic Add-In. To do this, use the following formulas:
=REGISTER("GENERIC.XLL","FUNC1") =REGISTER("GENERIC.XLL","FUNCSUM") To BuildThis project must be built as a 32-bit application. NMAKE can be used with the attached makefile to build this project.
REFERENCESMicrosoft Excel Developer's Kit, version 5. Keywords : kbsample kbusage kbfile kbprg Version : 4.0 3.5 3.51 Platform : NT WINDOWS Solution Type : kbfile |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |