问题
We are using XLDNA to make a small VB.net XLL that loads our data files and places the contents in Excel for editing. When we tried to deploy this among our three-person team, it was like an episode of the Three Stooges - it would work fine on one machine but then tell us that it was not a valid XLL on another, causing much head-smacking.
We realized with was 32/64 related, but also found that the machines in question randomly had the 32 or 64 version of Excel even though they are all the same model, running the same OS, installing XL from the same DVD! If we can't figure this out, I suspect our users will have an even harder time of it.
So... is there a way to make a single XLL that contains both 32 and 64 bit code?
回答1:
No, you can't make a single XLL for 32 and 64 bit. See the source for an Excel-DNA based project like PMStockQuote. You'll see it generates two distinct .xll binaries, one for x86 and one for x64. I guess you need to fix your install procedure to figure whether EXCEL.EXE lives under c:\Program Files, or c:\Program Files (x86).
来源:https://stackoverflow.com/questions/28154364/making-an-xll-that-runs-under-32-and-64-bit-excel