PRB: Existing XLL Not Recognized by Excel After Recompilation

ID: Q194926


The information in this article applies to:


SYMPTOMS

When building an XLL in Visual C++ 6.0, you may get the following error message when trying to load the Excel .xll file:

The file is not in a recognizable format
The error occurs when loading the debug build of the XLL, but not with the release build.


CAUSE

The project has been compiled in Visual C++ version 6.0 with debug information using the new "Edit and Continue" format. This is why a release build of the XLL works and a debug build that uses "Edit and Continue" for the debug information format fails. The default setting for a debug build in Visual C++ version 6.0 is to use a "Program database for Edit and Continue." This causes tokens to be inserted in the compiled program that are not recognized by Excel.


RESOLUTION

Use one of the following workarounds:


STATUS

This behavior is by design.


MORE INFORMATION

Steps to Reproduce Behavior

  1. On the Microsoft Excel 97 Developer's Kit, locate the Samples folder, and copy the Framewrk project to your computer.


  2. In Visual C++ version 6.0 start a new Win 32 Dynamic Link Library project named Framewrk.


  3. Add to that project all of the files in the sample folder named Framewrk. Remember to add the .def file. You now have two folders named Framewrk. One is your project, and the other is the sample file folder. You can delete the latter if you wish.


  4. On the Build menu of Visual Studio, click "Set Active Configuration..." and select Win32 Debug.


  5. Click Rebuild All on the Build menu.


  6. The build process adds a Debug folder to your project, and in that you will see a file named Generic.dll. Rename that file to Generic.xll.


  7. Double-click Generic.xll.


RESULT: Excel starts, but it does not load a worksheet. Instead, the following message appears:
This file is not in a recognizable format.

Additional query words: SDK Add-in


Keywords          : kberrmsg kbExcel kbLangC kbLangCPP kbVC600 kbSDKExcel 
Version           : WINDOWS:1.0; WINNT:6.0
Platform          : WINDOWS winnt 
Issue type        : kbprb 

Last Reviewed: July 28, 1999