XLL fails to load on other machines

436 views
Skip to first unread message

Timothy Jeffryes

unread,
Apr 22, 2016, 3:38:27 AM4/22/16
to Excel-DNA
I've been stepping through the article "vba-to-vb.net-xll-add-in-with-excel-dna.pdf".

I created the project called TestPIA and the XLL from the bin folder works fine on the machine where it was created in both Excel 2010 and Excel 2016. 

I have used exceldnapack.exe and it has created the packed XLL just fine and it too runs with both versions on Excel on this same machine.  However, no matter how many configurations I have tried, it does not seem to load on other machines, whether they have XL2010, XL2013, or XL 2016.   It *appears* as though it *may* have loaded on a machine with Excel 2003, but I can't be sure because earlier I tried to run the non-packed version and it ran fine and I'm not sure if that may have "prepared" the machine to handle the packed version. 

Here is the contents of my TestPIA.dna:

<DnaLibrary Language="VB" RuntimeVersion="v4.0">
<ExternalLibrary Path="TestPIA.dll" Pack="true" />
</DnaLibrary>

I also set, in visual Studio, Embed Interop Types to True for Microsoft.Office.Interop.Excel.

When attempting to load on other machine, virtually nothing happens.  Not even an error message. 

If I manually load the XLL (as opposed to double-clicking), it appear to load just fine, as it appears in the list of add-ins, checked.  But no menu item.

Tim

Govert van Drimmelen

unread,
Apr 22, 2016, 2:02:07 PM4/22/16
to Excel-DNA
Hi Tim,

Do you have any other dependencies (References) of your library?
These would have to be added to the .dna file as 
    <Reference Path="..." Pack="true" />
tags as well.

It might even be something that is not copied to your output directory, but is installed on your machine and not the others.

-Govert

Govert van Drimmelen

unread,
Apr 22, 2016, 3:11:46 PM4/22/16
to Excel-DNA
Another test is to take the ExcelDna.dna and ExcelDna.xll files from the distribution, and confirm that this simple add-in works on the problem machines.

-Govert

Gareth Hayter

unread,
Apr 25, 2016, 7:52:57 PM4/25/16
to Excel-DNA
@Govert: I also have this problem. My add-in doesn't run on certain machines....but luckily I have a VM with a setup that exhibits this exact problem!

I've tried to run some of the Ribbon samples from the Distribution folder, and none of them work. (I use the Ribbon examples because it's easy to see whether the add-in loaded or not).

I don't see any errors or exceptions. I have no idea why the XLLs don't load.

What are the steps to debug the VS source while loading one of the dna files from the samples folder?

Thanks,
Gareth.

Govert van Drimmelen

unread,
Apr 26, 2016, 3:34:00 AM4/26/16
to Excel-DNA
Hi Gareth,

Do you mean that no Excel-DNA add-ins load on that virtual machine, or only some specific add-ins?
Security settings can cause an Excel to silently refuse to load any add-ins.
The ribbon and other COM parts (as opposed to plain UDF function definitions) have many other ways of failing to load.

You can start Excel, then attach a VS debugger (picking the native debugger engine), then see whether there is anything interesting in the debug output.

-Govert

Gareth Hayter

unread,
Apr 26, 2016, 10:16:11 PM4/26/16
to Excel-DNA
Hi Govert

No Excel-DNA add-ins from the Samples folder run: none, zero, zilch, nada ;-)

All Excel security settings are turned off.

No errors are displayed.

I couldn't debug it either, although I might have followed the incorrect steps:
  1. Start Excel
  2. Attach VS to the Excel process, using the native debugger
  3. Open the test XLL via the Excel Open command
No errors.

Thanks,
Gareth.

Govert van Drimmelen

unread,
Apr 27, 2016, 3:22:09 AM4/27/16
to exce...@googlegroups.com
Hi Gareth,

OK great.
The next two questions:

* Is VBA installed (if you press Alt+F11, does the VBA IDE open)?

* Do other (not Excel-DNA) .xlls work? You can try a pre-built version of the Generic.xll sample from the Excel SDK here: https://dl.dropboxusercontent.com/u/639121/GENERIC.xll It gives you a few functions like "Func1" and "Fib".

-Govert




From: exce...@googlegroups.com [exce...@googlegroups.com] on behalf of Gareth Hayter [gareth...@gmail.com]
Sent: 27 April 2016 04:16 AM
To: Excel-DNA
Subject: [ExcelDna] Re: XLL fails to load on other machines

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.

Gareth Hayter

unread,
Apr 27, 2016, 5:27:16 PM4/27/16
to Excel-DNA
Hi Govert

  1. VBA is not installed, and I've got a gut-feeling that you've hit the nail on the head. I can't find my Excel 2010 install disc at the moment to modify the configuration and add VBA back in to see if it fixes the issue. I see on this MS page that "Note: Compiled add-ins such as .xll files, COM Add-ins, and Automation Add-ins are not affected by whether or not VBA is installed."https://support.microsoft.com/en-us/kb/282847
  2. No, the other XLL doesn't work either.
Kind regards,
Gareth.

Govert van Drimmelen

unread,
Apr 27, 2016, 5:35:10 PM4/27/16
to exce...@googlegroups.com
Hi Gareth,

If VBA is not installed, then definitely no type of add-in can be loaded.

Perhaps the option where 'VBA is disabled' that is described in the KB article refers to some other setting.

-Govert



Sent: 27 April 2016 11:27 PM
To: Excel-DNA
Subject: Re: [ExcelDna] Re: XLL fails to load on other machines

--

Gareth Hayter

unread,
Apr 27, 2016, 11:09:08 PM4/27/16
to Excel-DNA
Hi Govert

Thank-you for clearing that up. Now it's just a matter for me to modify the installer to check whether VBA is installed.....and there doesn't seem to be any registry key relating to this!

Many thanks,
Gareth
Reply all
Reply to author
Forward
0 new messages