UDF & .NET code without Installer or Addin

59 views
Skip to first unread message

Chad Kelley

unread,
Jul 12, 2021, 4:11:32 PM7/12/21
to Excel-DNA
Is there any way possible to create an Addin or code base for a File and NOT for the Excel instance.  Currently i have a VSTO .net project that i have to install on EVERY machine for each user.  However, this is a pain and i have successfully created an Excel-DNA Addin but from my understanding the addin needs to be installed and added based on the Machine and Excel Application, not the Actual File.  Can we create Code, "embed it in the File (like VBA Code) and send the File Around without issues?  

Yes i understand the users machine needs the correct version of .net Framework etc.


thanks in advance

Govert van Drimmelen

unread,
Jul 13, 2021, 4:34:43 AM7/13/21
to exce...@googlegroups.com

Hi Chad,

 

Excel-DNA only makes Excel add-ins.

With the right settings, your add-in and dependencies can usually be packed into a single .xll file (actually one .xll file for 32-bit and one for 64-bit Excel).

This file can be copied anywhere on the user’s machine and opened from Excel with File -> Open or installed as an add-in by opening the Alt+t, i dialog box in Excel.

You can make a whole installer for the add-in, but this is not required, and admin permissions are not required to install it.

 

Excel .xll add-in files are not associated with a specific workbook.

If you have a template workbook(s) that the add-in is associated with, you could embed these as resources in your library and extract and use them at runtime.

So for some cases you can see the whole .xll add-in as just replacing the workbook which you’d send around without issues.

 

I’ve heard of users who have taken other approaches.

One is to have a workbook with some VBA code that check when opened and copies or downloads the add-in file and installs it if required.

Or they have written VBA code where the add-in is embedded inside a workbook (I think as a CustomXML part) and then extracted and installed at runtime.

I don’t have code or an example of these, though.

 

-Govert

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/7a3081df-83e2-4760-b17a-bd3b0b6c5846n%40googlegroups.com.

Chad Kelley

unread,
Jul 15, 2021, 9:55:16 AM7/15/21
to Excel-DNA
Hey Thanks for the information Govert.  I have a Template (*.xlsb) file that I use to distribute to different people across the USA.  so I like the idea of what you're saying above.  

"If you have a template workbook(s) that the add-in is associated with, you could embed these as resources in your library and extract and use them at runtime."

if i can somehow embed an XLL file inside the template and distribute without issues this would be the way to go.  Do you have any links or info?


FYI, i have created XLL Addins using Excel DNA, i'm just a little unsure of hwo to actaully "embed" this into my template excel file?


Thanks for the good work.



Govert van Drimmelen

unread,
Jul 15, 2021, 10:05:48 AM7/15/21
to Excel-DNA
It's probably easier to embed the template workbook inside the .xll file, and then distribute this single file Excel add-in.
Then your add-in can have a ribbon button or something that opens a copy of the template workbook when needed.

Doing it the other way, where you try to embed the binary add-in inside a workbook would need something like a Base64 encoding of the binary, which is in turn inserted into the workbook as a CustomXMLPart.
Then you need some VBA to extract this binary from the workbook and load as an add-in.

Either way, you're in for a fair amount of fiddling to avoid sending one or two extra files.

-Govert

FastExcel

unread,
Jul 26, 2021, 4:16:40 AM7/26/21
to Excel-DNA
I package the XLL3 (32 and 64 bit) and the workbook together in a zip file so that users can easily put the files in a single folder. The workbook contains some simple VBA in the workbook open event that detects 32 or 64 Excel bitness and then loads the correct XLL.
Reply all
Reply to author
Forward
0 new messages