Excel VSTO Addin soft-disabled anf UDFs are shown RRS feed

  • General discussion

  • I am trying to write some uder defind functions for Excel and am having trouble getting them enabled. I have read most of the posts on this topic and have not been able to overcome this problem. Here is the scenario.

    I am running VS2015 and Excel 2013. I do have a VSTO app successfully working that uses a ribbon and a Windows Form. I added another project to this solution for Excel 2013 and 2016 VSTO Add-in, the followed the process of add a Functions class with necessary methods to all register and unregister the function. There are only a couple of trivial functions in the class at this time, just to make sure they should up on the functions list in Excel. I have the project registered from COM interop.

    When I start Excel, either using Debug mode from VS or by starting the App, I can see the add-in in several different places. First the Add-Ins table shows MyName.Functions check and listed with the description ProgId: MyName.Functions. Under COMM Add-Ins, there is MyName checked and the location points to the correct dll and the load behavior is 'Load at Startup'.  In Add-Ins options, I see MyName under the Active Application Add-Ins and MyName.Functions under the Inactive Application Add-ins. None of my functions are showing up when I enter a formula in an Excel cell.

    I have placed a checkpoint in ThisAddIn_Startup and the method is getting activated. The code in this method reads:

                System.Environment.SetEnvironmentVariable("VSTO_LOGALERTS", "1");
                System.Environment.SetEnvironmentVariable("VSTO_SUPPRESSDISPLAYALERTS", "0");
    I have not been successfully in getting any displays or log messages, however.

    Tuesday, December 13, 2016 4:09 PM

All replies

  • Hello Bob,

    Have you tried to add any logging statements to the code? Do you get any exceptions?

    Can you reproduce the issue if you split projects and run Excel with both registered separately?

    You may find the Troubleshooting COM Add-In load failures article helpful.

    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Tuesday, December 13, 2016 4:33 PM
  • See my message for how I am trying to produce log messages. Is this right?

    I am not sure what you mean by splitting projects. Are you saying to separate my two projects into two different solutions? I am not sure there as any associate between this projects. I have disabled the other one by setting its LoadBehavior to 2.

    My progress on the referenced article.

    1. The add-in is inactive and enabled. It is not disabled.

    2. I don't know how to do this 'Make sure there is no error thrown by IDTExtensibility2::OnConnection and IDTExtensibility2::OnStartupComplete event handlers. '

    3. Create object - VBS returns 'can't create ActiveX object'

    4. Don't think this is an antivirus block

    5. All other add-ins have LoadBehavior of 2.

    I ran the fusion logger and all indicatios are that my dll loaded properly

    I have no <application>.exe.config file

    BTW. I used 'Writing user defined functions for Excel in .NET ' at MSDN to create my Excel 2013 addin project
    • Edited by ENSCO Bob Wednesday, December 14, 2016 1:14 PM
    Tuesday, December 13, 2016 7:30 PM