none
Excel UDF return #NAME? (AddIn does not load) when executed programmatically RRS feed

  • Question

  • I have a COM-Addin providing some user defined functions (UDF) and everything works fine in Excel 2003 and Excel 2007 when I create a new or open an existing workbook manually.
    But when I open an existing workbook programmatically, the AddIn does not start (though it can be found in the AddIns-List; the OnConnection methode of the Extensibilty Interface is not called).
    So when I recalculate the UDFs using Appilcation.CalculateFull() (does not matter if the function is volatile or not), all UDFs return #NAME?. Again both in Excell 2003 and 2007 and no differnce between xls and xlsx format.

    Can anybody tell me what works wrong? Thx in advance for help!

    Tuesday, May 10, 2011 9:36 AM

Answers

  • Hello,

    This is an expected behavior, see http://support.microsoft.com/kb/213489. You can try turning the UDF off and on in the WindowActivate event, something like ExcelApp.Addins.Item(myAddin).Installed = true/false.


    Regards from Belarus (GMT + 2),

    Andrei Smolin
    Add-in Express Team Leader
    • Marked as answer by Heino Siem Tuesday, May 10, 2011 2:59 PM
    Tuesday, May 10, 2011 12:28 PM

All replies

  • Hello,

    This is an expected behavior, see http://support.microsoft.com/kb/213489. You can try turning the UDF off and on in the WindowActivate event, something like ExcelApp.Addins.Item(myAddin).Installed = true/false.


    Regards from Belarus (GMT + 2),

    Andrei Smolin
    Add-in Express Team Leader
    • Marked as answer by Heino Siem Tuesday, May 10, 2011 2:59 PM
    Tuesday, May 10, 2011 12:28 PM
  • Hi Andrej,

    your hint with setting ExcelApp.Addins.Item(myAddin).Installed to false and then to true again within the WindowActivate event worked well.
    Thanks a lot, that's what I was looking for for two days now! 

    Best wishes from Germany, Heino

    Tuesday, May 10, 2011 2:59 PM
  • Hi I am having the same problem, though it may be slightly different set up.

    VSTO
    VS2008 SP1
    .NET 3.5
    Excel 2007

    I am a .net noob. I am trying to load an automation addin that is an excel application/automation addin (it is a dll not xla or xll) from within a vsto addin in the ThisAddIn_Startup() method of the vsto addin. From google i got the below solution which is not working.

    I am using the addin.installed = true/false trick and even though i can see the value of this property being changed, when i start up excel and and populate my sheet with udfs from the automation addin programmatically i get the #NAME? error. If i call the udfs in excel by typing them into a cell by hand this causes the automation addin to get loaded and then when i populate programmatically it works. Is there no way to load programmaticall an automation addin from a vsto addin?


    • Edited by buki O Tuesday, May 1, 2012 3:43 PM
    Tuesday, May 1, 2012 3:40 PM