none
AddIn.Object returns null on certain machines RRS feed

  • Question

  • I have:
    1. A VSTO Excel Add-In;
    2. An override object RequestComAddInAutomationService() which returns an instance of a class which is annotated as
        [ComVisible(true)]
        [ClassInterface(ClassInterfaceType.None)]
       and implements an interface which is annotated
        [ComVisible(true)]
        [InterfaceType(ComInterfaceType.InterfaceIsDual)]
    3. Accessing the Globals.ThisAddIn.Application.COMAddIns.Item("MyAddinName").Object from the addin process I am able to get the above mentioned class;
    4. Accessing Marshal.GetActiveObject("Excel.Application").COMAddIns.Item("MyAddinName").Object in c# code which is called (Excel DNA) from a VBA macro I usually am able to get the above mentioned class. But. On certain machines this reference is null. Anyone knows what could be the reason?
    Wednesday, July 24, 2013 3:36 PM

Answers

  • verify on those certain machines if COM entries for your class and interface are actually in proper places in regostry (take special care checking bitness of office and paths in registry (SysWOW64 or not))
    • Marked as answer by cesare76 Thursday, July 25, 2013 10:29 AM
    Thursday, July 25, 2013 6:37 AM

All replies

  • verify on those certain machines if COM entries for your class and interface are actually in proper places in regostry (take special care checking bitness of office and paths in registry (SysWOW64 or not))
    • Marked as answer by cesare76 Thursday, July 25, 2013 10:29 AM
    Thursday, July 25, 2013 6:37 AM
  • Thank you! it seems to work now.
    Thursday, July 25, 2013 10:29 AM