run a .xll at startup from VSTO ThisAddIn_Startup

Jun 14, 2011 at 5:56 PM

RIght now I am debugging my UDF's by hand loading the .xll.

I have VS 2010 packing the .dll with the loader and other stuff.


how do I get this to load the .xll programatically ?

Installing it as an Add In does not work on the next program startup.

It works on load, but does not persist.

I notice that .xla's seem to load on new startup.

How do take a packed .xll and generate an .xla ? 


Finally, how do I launch the .xll load programatically on the VSTO On Startup stub ?





Jun 14, 2011 at 9:54 PM

Hi dB,

If you make a new .xll, and add it into Excel using the Add-Ins dialog (Alt+t, i), it should be loaded subsequently when Excel starts. Could you try that with a new copy of ExcelDna.xll from the distribution to some name, say TestLoad.xll and a matching TestLoad.dna file? I vaguely recall a case which had some problem loading automatically, but I think the problem was something in that particular add-in.

Adding an Excel .xll add-in to the add-ins dialog creates a registry value under HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Options\ with the name OPEN, or OPEN1, OPEN2 etc. The value data is "\R c:\...path to...\TestLoad.xll". You can check whether the right entry gets made here.

For your other questions:

* You cannot create a .xla from a .xll. These are totally different add-in technologies.

* You can load an .xll programatically from VBA or from VSTO with Application.RegisterXLL.



Jun 15, 2011 at 9:23 PM

 i made a production rule to generate the packed .xll from the .dll, but it

seems to load all of the .dlls in the VS2010 ./Debug directory. 

I have the source and I will tinker with that. It seems to have a fallback path to

find .dlls. I only want the dll i want to get packed into a .xll.


the problem with using VSTO is it regenerates a blank .xlsx.

I want to regenerate the spreadsheet with my test UDF's loaded,

so I can set breakpoints in my code. 


also, how can i programatically load my .xls from c# ? I would like to do that

to be certain it is loaded, or look at a list of add'ins before I load.


I think the inclusion of all the .dll in the packing is causing the load problems.


I will test some known dlls.



Jun 15, 2011 at 9:42 PM

nothing there under options

It appears under 14.0 

Jun 15, 2011 at 9:45 PM

yeah! it works... now can in install this in c# from the addin ?

ultimate i want to distribute .xll s by .msi installers