COM TypeLibrary Registration

Nov 13, 2012 at 12:06 PM

Hi Govert,

I have an AddIn that implements a ComServer exposing COM Interfaces defined in a referenced DLL. I've worked out that I can get Excel-DNA to also pack the COM TypeLibrary for the referenced DLL if I declare it as an ExternalLibrary rather than a Reference in the .dna file (maybe this should have been obvious but I'm fairly new to Excel-DNA!)

The problem I've got is that Excel-DNA isn't automatically registering the additional TypeLibrary when ComServer.DllRegisterServer is called. Debugging this call I see that's it's because the referenced DLL doesn't contain any COM creatable classes - only interfaces. I'm going to work around this by using reflection to call into Excel-DNA and explicitly register any TypeLibraries in the DnaLibrary.CurrentLibrary.ExternalLibraries collection but was wondering if this is something Excel-DNA should always do regardless of the associated DLL containing COM creatable classes?



Nov 13, 2012 at 2:03 PM

Hi David,

Generally if a library had no COM createable classes, I guess I expected that it could not be used from VBA.

I'll consider your suggestion and have a look at how serious the change would be.