So I am using Excel-DNA to pack two COM dlls inside one XLL.
<ExternalLibrary Path="FancyDna.DllOne.dll" ExplicitExports="false" LoadFromBytes="true" ComServer="true" Pack="true" />
<ExternalLibrary Path="FancyDna.DllTwo.dll" ExplicitExports="false" LoadFromBytes="true" ComServer="true" Pack="true" />
And in VBA:
Sub TestEarlyBound()
Application.RegisterXLL Application.ActiveWorkbook.Path & "\build\FancyDna.Pack-AddIn64-packed.xll"
ThisWorkbook.VBProject.References.AddFromFile Application.ActiveWorkbook.Path & "\build\FancyDna.Pack-AddIn64-packed.xll"
Call CallDllOne
Call CallDllTwo
End Sub
However, when I add the references in VBA using ThisWorkbook.VBProject.References.AddFromFile
, only one Dll is referenced with checkbox ticked. The other dll shows up in the Tools --> References after doing that but its checkbox is not checked!
I saw it here that tlb's can be packed in XLL which in return can be referenced in VBA to get full early binding support.
It would be really cool to pack several Dlls in one XLL and also register them programmatically for early binding with intellisense and everything. What am I doing wrong here?