5

The error is:

The file you are trying to open, 'ExcelDna.xll', is in a different format than specified by the
file extension. Verify that the file is not corrupt and is from a trusted source before opening the file.

Dean Radcliffe
  • 2,194
  • 22
  • 29
  • Never mind, I tried loading the ExcelDna64.xll (I'm on 64-bit Office) and that helped. A related symptom was that if I said 'Yes' to the above dialog, upon opening the XLL via File->Open, I'd get the Text Import Wizard. You'd think Microsoft could detect the version the add-in is compiled for and complain more specifically. – Dean Radcliffe Jun 29 '11 at 22:48

2 Answers2

8

Yes - this is exactly the behaviour you get when an .xll add-in has the wrong 'bitness' for the Excel process. For Excel-DNA you need to use a copy of ExcelDna.xll for 32-bit Excel versions (running on 32-bit or 64-bit Windows), and a copy of ExcelDna64.xll for the 64-bit version of Excel 2010.

Note that on all versions of Windows (both 32-bit and 64-bit) the recommended and default installation of Office is the 32-bit version.

Govert
  • 16,387
  • 4
  • 60
  • 70
  • This helped me. I didn't realise my workplace had helpfully moved us from 32 bit Excel to 64 bit on a machine change. Thanks! – Craig Brett Jan 10 '19 at 09:28
3

I've just had exactly the same problem, but NOT because of using DNA64. In my case the problem appeared when I was loading the XLL from C:\Temp\[blah]\myXll.xll If I copied the xll (and related folders) to C:\Program Files (x86)\[blah]\ then it worked fine.

Smita
  • 4,634
  • 2
  • 25
  • 32
Bamboozled
  • 31
  • 1