C++ 64-bit Excel add-in (XLL) is not loading correctly in 64-bit Excel
Asked Answered
N

3

3

I have a piece of C++ code, which creates a XLL (Excel add-in). It can be successfully loaded by Excel, and works perfectly.

Then, I switched to 64-bit Excel, and the code stopped working. So I have recompiled the code in Visual Studio using x64 platform settings. The compilation went error free.

Now when I try to load it in 64-bit Excel, Excel does not recognize the file extension:

enter image description here

It complains showing "The file format and extension of 'MyAddin.xll' don't match.", and gives me the follwoing options to continue: yes, no, or cancel.

If I ignore the message and press yes, then the add-in crashes, and I get the error:

This program cannot be run in DOS mode.

Since the add-in compiles correctly, I am not sure how to troubleshoot this error. My question is: Can anyone please give me any pointers as to how to overcome the problem?

My requirements are:

  1. 64-bit Excel must recognize my XLL as valid add-in (the first error message has to go away)

  2. What means the second error?

Norrie answered 8/10, 2012 at 23:37 Comment(1)
This one is closely related: #46046862Ornament
D
1

That message typically means the runtime linker can't find a dll. Use depends.exe (64-bit) from sysinternals to find out which. You can ignore xlcall32.dll and ieshims.dll warnings.

Deputy answered 9/10, 2012 at 22:52 Comment(2)
i only see ieshims.dll missing. nothing else shows up in depends.exe(64-bit). when i drop the dll in excel(64 bit) i get the msg "the file you are tyring to open, test.dll" is an a different format then specified by the file extension" and then when i click "yes" i get the dos error.Norrie
Sounds like you are missing 64-bit xlcall32.lib in your hermit colony. :-) You will find that in the lib/x64 of the SDK. Link your 64-bit dll with that by adding it to your project.Deputy
A
1

You use the 32 bit version of Excel to open the 64 bit plug-in, and you will report errors that can only be opened under DOS. You need to install a 64 bit (normally unable to install 32 bit and 64 bit) office to open the 64 bit plug-in!

Abate answered 16/11, 2017 at 8:36 Comment(0)
W
0

As mentioned by Keith, this error is likely because some .dll dependency is not being found. One specific problem that can arise is if your .xll is calling another .dll which lives in the same directory. When Excel starts up and loads the .xll it will search its working directory and be unable to find the .dll.

One way around this is to add the .dll's directory to your Path.

Weak answered 10/12, 2013 at 6:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.