There are two Excel addins, and one that explicitely mentions using ExcelDna, that support shipping code with your workbook (xlsx), but requires their runtime install to work.
Has anyone investigated how they bundle code with xlsx files?
It seems you can use xml parts (either as xml or as arbitrary files, I remember finding a stackoverflow post that mentions bundling an .ini file with it). Would they base64-encode C# code and compile it everytime when the workbook opens?
Or would you compile it beforehand and store it (as a dll?) in base64? Would that trigger some antivirus?