Excel Dna Addin for 64 bit Excel issues

1,931 views
Skip to first unread message

Rahman Mahmoodi

unread,
Oct 8, 2013, 1:40:37 AM10/8/13
to exce...@googlegroups.com
Hi Guys,

I can see that there are many questions in this topic but unfortunately there is not step by step instruction on how this should work.

We are trying consider to use ExcelDna to convert a legacy COM DLL that is written in VB6 and does not work under 64 bit Excel anymore.
But every step that I follow I am faced with some sort of issue.

What are the steps to make an addin to work in 64 bit Excel?

My tests are working for 32 bit Excel.

What should I do to get this working under 64 bit Excel?
Can anyone please explain the exact steps??
I am not clear about the "ExcelDnaPack.exe".

thanks

Govert van Drimmelen

unread,
Oct 8, 2013, 2:54:18 AM10/8/13
to exce...@googlegroups.com
Hi Rahman,

Excel-DNA fully supports the 64-bit version of Excel, but only with the .NET 4 (or later) runtime.

Your add-in library (MyTest.dll) may target "AnyCPU", so you son't need different versions of your own code for 32-bit and 64-bit.
However, the .xll file that loads and registers your code is a native library, so there are two versions - ExcelDna.xll and ExcelDna64.xll.

To indicate that the .NET 4.0 runtime should be loaded, your MyTest-AddIn.dna file might then look like this:
<DnaLibrary RuntimeVersion="v4.0" >
    <ExternalLibrary Path="MyTest.dll" />
</DnaLibrary>

The three files then form a complete 64-bit add-in:
* MyTest.dll
* MyTest-AddIn.dna
* MyTest.Add.xll (which is just a renamed copy of ExcelDna64.xll)

If you copy and rename ExcelDna.xll instead, you have a 32-bit add-in.

The .dna file and .xll file can be renamed to anything you like, as long as they have the same root name (the .xll file looks for the .dna file by name).
So you might have something like:
* MyTest.dll
* MyTest-AddIn32.dna
* MyTest.Add32.xll (a renamed copy of ExcelDna.xll)
* MyTest-AddIn64.dna (just a copy of the other .dna file)
* MyTest.Add64.xll (a renamed copy of ExcelDna64.xll)

Once this works fine and you're happy, you can worry about advanced features like packing into a single file.

Please write back is you have more questions.

Regards,
Govert

Govert van Drimmelen

unread,
Oct 8, 2013, 3:11:05 AM10/8/13
to exce...@googlegroups.com
Sorry - my typing and editing are not so good this morning.

The .dna file and .xll files must have the same name. So:
* MyTest.dll
* MyTest-AddIn.dna
* MyTest-AddIn.xll (which is just a renamed copy of ExcelDna64.xll)

and
* MyTest.dll
* MyTest-AddIn32.dna
* MyTest-AddIn32.xll (a renamed copy of ExcelDna.xll)
* MyTest-AddIn64.dna (just a copy of the other .dna file)
* MyTest-AddIn64.xll (a renamed copy of ExcelDna64.xll)

-Govert

Rahman Mahmoodi

unread,
Oct 9, 2013, 12:17:58 AM10/9/13
to exce...@googlegroups.com
Hi Gover,

Thanks for the reply.

Are you saying if I copy these 3 files without any packaging then I should be able to test my stuff under 64 bit?

* MyTest.dll
* MyTest-AddIn64.dna (just a copy of the other .dna file)
* MyTest-AddIn64.xll (a renamed copy of ExcelDna64.xll)

rahman

Govert van Drimmelen

unread,
Oct 9, 2013, 12:22:24 AM10/9/13
to exce...@googlegroups.com
Yes - that should work.

-Govert

Rahman Mahmoodi

unread,
Oct 9, 2013, 11:53:47 PM10/9/13
to exce...@googlegroups.com
Thanks Govert,

That was the solution. At least the add-in registered.

However, I am getting "ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application"

Since I am using ODBC and DSN to connect to database, I am sure its some Microsoft related issue?

regards,


Rahman

Govert van Drimmelen

unread,
Oct 10, 2013, 6:05:39 AM10/10/13
to exce...@googlegroups.com
Hi Rahman,

It seems like you're loading an ODBC driver which uses some 32-bit native library.

You can isolate the issue away from Excel and Excel-DNA by making a C# console or WinForms application where you set the architecture to x64, and then load the same ODBC stuff. You should get the same error, and can then figure out from there how to point to the right ODBC driver or access the database in some other way.

-Govert
Reply all
Reply to author
Forward
0 new messages