loading a excel addin xll from visual studio debug

我的未来我决定 提交于 2019-12-24 13:11:30

问题


i create a debug version of an excel addin lets call it myaddin.xll. when i open an instance of excel and add myaddin.xll to it i get the expected result. but when i hit debug from within visual studio environment the myaddin.xll tries to open and gives a "this program cannot be in dos mode" error.

for other excel addin i have developed i do not have this problem. this problem is suddenly occuring for this particular addin. "dos mode..." error usually happens when something is missing. clearly the addin does not have any missing component because it opens in excel. but the some component gets missing when i try to open from within visual studio. my question is how to i figure out what is causing the error and fix it.

when i hit debug excel opens up and then gives a pop up "you file myaddin.dll is in a different format than specified by the file extension...." when i hit ok to that pop up i get garbage characters in the spreadsheet.


回答1:


You need to Configure Visual Studio to : 1) run Excel 2) load your .xll and 3) add your dll dependencies path (right click projet-"Configuration Properties" -> "Debug") :

-Don't forget to switch the extension ("Configuration Properties" -> "General) of the dll to .xll.

-Don't miss the Govert (loading a excel addin xll from visual studio debug) comment regarding x64bit versus 32 bits.



来源:https://stackoverflow.com/questions/15318477/loading-a-excel-addin-xll-from-visual-studio-debug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!