I've tried adding the following code to the beginning of my add-in code as such:
Namespace NS
[Guid("211B3945-E2AE-48DD-8A9A-77ADB40EC6D5")]
[ComVisible(true)]
public partial class Classname
{
but it doesn't appear when I list the COMAddins (the name does, but not the GUID).
I've also tried setting it in my compile settings under Assembly information with no luck.
BTW - the issue I'm trying to resolve is seeing if a COM Addin is loaded by searching for its GUID. The Addin description shows up when I check the list of ComAddIns, but the GUID still shows zeroes no matter how I follow these directions. I'm trying to see what's visible by using the following code:
olApp = this.Application;
Office.COMAddIns CAIs = olApp.COMAddIns;
foreach (Office.COMAddIn CAI in CAIs)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine(CAI.Description);
sb.AppendLine(CAI.Guid);
sb.AppendLine("****");
Debug.Print(sb.ToString());
}
There are a number of things missing here to expose COM, including overriding RequestComAddInAutomationService
and setting [InterfaceType(ComInterfaceType.InterfaceIsDual)]
See the following items:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With