问题描述
我有一段 C++ 代码,它创建了一个 XLL(Excel 插件).Excel可以成功加载,完美运行.
I have a piece of C++ code, which creates a XLL (Excel add-in). It can be successfully loaded by Excel, and works perfectly.
然后,我切换到 64 位 Excel,代码停止工作.所以我使用 x64 平台设置重新编译了 Visual Studio 中的代码.编译没有错误.
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.
现在,当我尝试在 64 位 Excel 中加载它时,Excel 无法识别文件扩展名:
Now when I try to load it in 64-bit Excel, Excel does not recognize the file extension:
它抱怨显示'MyAddin.xll' 的文件格式和扩展名不匹配.",并为我提供以下选项以继续:yes
、no
或 取消
.
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
.
如果我忽略该消息并按 yes
,则加载项会崩溃,并出现错误:
If I ignore the message and press yes
, then the add-in crashes, and I get the error:
此程序无法在 DOS 模式下运行.
由于加载项正确编译,我不确定如何解决此错误.我的问题是:任何人都可以就如何克服这个问题给我任何指示吗?
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?
我的要求是:
64 位 Excel 必须将我的 XLL 识别为有效的加载项(第一条错误消息必须消失)
64-bit Excel must recognize my XLL as valid add-in (the first error message has to go away)
第二个错误是什么意思?
What means the second error?
推荐答案
你用32位版本的Excel打开64位插件,会报只能在DOS下打开的错误.需要安装64位(一般无法安装32位和64位)office才能打开64位插件!
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!
这篇关于C++ 64 位 Excel 加载项 (XLL) 未在 64 位 Excel 中正确加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!