PRB: My XLL does not work on a user's machine

Reference: Q0011

Article last modified on 28-May-2008


The information in this article applies to:

  • XLL+ for Visual Studio 6 - 3, 4.1, 4.2, 4.3.1, 5.0
  • XLL+ for Visual Studio .NET - 3, 4.1, 4.2, 4.3.1, 5.0
  • XLL+ for Visual Studio 2005 - 5.0
  • Excel - all versions

My XLL does not work on a user's machine; Excel shows an error message: "This file is not in a recognizable format".

Issue

I build an XLL and it runs on my development machine. When the XLL is copied to a user's machine, it fails to load, and Excel shows a dialog box, saying: "This file is not in a recognizable format".

Summary

  1. XLLs built using XLL+ require certain run-time dynamic link libraries (DLLs) to be present and available. All these DLLs are delivered to development machines when Visual Studio is installed. However, they may not be present on user machines.
  2. Check the list of DLLs that are required by your XLL. (See Run-time requirements below for details.)
  3. Ensure that each DLL is properly installed on the user machine.
  4. Check the Notes section on this page.

Run-time requirements

The table below lists all the DLLs required at run-time by XLLs built with various XLL+ libraries and DevStudio versions.

In addition, you can get a full list of the dependencies of a binary file by using the Dependency Walker tool, which is provided as part of Visual Studio 6, and which can also be found at http://www.dependencywalker.com/.

Visual Studio XLL+ Libraries Build Requirements
VS 6 MFC Debug MFC42D.DLL
MFCO42D.DLL
MSVCP60D.DLL
MSVCRT.DLL
MSVCRTD.DLL
XLCALL32.DLL1
VS 6 MFC Release MFC42.DLL
MSVCP60.DLL
MSVCRT.DLL
XLCALL32.DLL1
VS 6 STL Debug MSVCRT.DLL
XLCALL32.DLL1
VS 6 STL Release MSVCRT.DLL
XLCALL32.DLL1
VS.NET 2002 MFC Debug MFC70D.DLL
MSVCP60.DLL
MSVCP70D.DLL
MSVCRT.DLL
MSVCR70D.DLL
XLCALL32.DLL1
VS.NET 2002 MFC Release MFC70.DLL
MSVCP60.DLL
MSVCP70.DLL
MSVCR70.DLL
MSVCRT.DLL
XLCALL32.DLL1
VS.NET 2002 STL Debug MSVCRT.DLL
XLCALL32.DLL1
VS.NET 2002 STL Release MSVCRT.DLL
XLCALL32.DLL1
VS.NET 2003 MFC Debug MFC71D.DLL
MSVCP71D.DLL
MSVCR71D.DLL
MSVCRT.DLL
XLCALL32.DLL1
VS.NET 2003 MFC Release MFC71.DLL
MSVCP71.DLL
MSVCR71.DLL
MSVCRT.DLL
XLCALL32.DLL1
VS.NET 2003 STL Debug MSVCRT.DLL
XLCALL32.DLL1
VS.NET 2003 STL Release MSVCRT.DLL
XLCALL32.DLL1
VS 2005 MFC Debug MFC80D.DLL
MSVCP80D.DLL
MSVCR80D.DLL
XLCALL32.DLL1
VS 2005 MFC Release MFC80.DLL
MSVCP80.DLL
MSVCR80.DLL
XLCALL32.DLL1
VS 2005 STL Debug MSVCRT.DLL
XLCALL32.DLL1
VS 2005 STL Release MSVCRT.DLL
XLCALL32.DLL1

1 XLCALL32.DLL is installed as part of Excel. It it is usually located in the same directory as the executable file EXCEL.EXE.

Installing DLLs

All DLLs must be available to Excel at run-time. This means that they must be located either:

  1. In the windows system directory (e.g. C:\Windows\System32).
  2. In a directory listed in the current PATH environment variable.
  3. In the same directory as the executable file EXCEL.EXE (e.g. C:\Program Files\Microsoft Office\Office10 etc).
  4. Installed in a sub-directory of [Windows]\WinSxS.
Note that putting a DLL in the same directory as your XLL is not usually sufficient. Even if it works under the debugger, it will almost certainly not work on a target machine.

Notes

Note that a standard Visual Studio license does not allow you to redistribute the Debug builds of Microsoft's run-time libraries. You should only redistribute Release builds.

When distributing DLLs for XLLs built with Visual Studio 2005, you should use the Microsoft installation program: follow the instructions for "Microsoft Visual C++ 2005 Redistributable Package (x86)" at URL http://www.microsoft.com/downloads/details.aspx?FamilyID=32BC1BEE-A3F9-4C13-9C99-220B62A191EE. You should ot install these files by hand.

For XLLs built using MFC and Visual Studio 2005, see also Visual C++ Deployment Examples (Microsoft).

If you wish to avoid any dependent files see Q0049: Build an MFC add-in which needs no runtime DLLs.