Hi Carlos,
Under a 64-bit version of Windows, you can install either a 32-bit
version of Office or a 64-bit version of Office. The default, and what
Microsoft recommends, is to install the 32-bit version of Office.
That's also what you have done.
So Excel is running as a 32-bit process on your 64-bit operating
system. Then the libraries that Excel loads must also be 32-bit, so
you'll use the regular Excel-DNA .xll. The 64-bit version -
ExcelDna64.xll - is only for the 64-bit version of Excel 2010. When
you try to open the 64-bit .xll under your 32-bit Excel, it gives the
"...different format than specified..." error. Since no code in the
library ever runs, Excel-DNA can't give a nicer message.
So the add-in that loads but gives some problems is indeed the right
one to use.
Now, there should be no difference in how Excel-DNA and .NET behaves
whether you are running on 64-bit Windows or 32-bit Windows. Also,
there have been no issues reported in this configuration that I
recall. Could you be seeing some problem with some external library,
or with some interaction with the operating system. Under Windows 7
some of the paths are different or are redirected in surprising ways.
Permissions could also be an issue.
Typically, #VALUE means that an exception was thrown in your method.
You can try to wrap the code in a try-catch block, and return details
on the exception, or register a general UnhandledExceptionHandler with
the Excel-DNA runtime (see
http://groups.google.com/group/exceldna/browse_thread/thread/973ca2e280a3c89f).
Could it be that you are referencing a 64-bit version of a mixed
(native and managed) assembly?
In summary - the behaviour you see with ExcelDna64.xll is what we
expect under the 32-bit version of Excel. The #NUM and #VALUE problems
in your add-in are not expected and are likely to be particular to
your configuration and functions.
Please post back if you find out anything more.
Regards,
Govert