none
How to display the short description of parameters / arguments of UDF developed in Automation Add-In using VSTO RRS feed

  • Question

  • How to display the short description of Help for parameters / arguments of UDF developed in Automation Add-In using VSTO
    • Moved by Cindy Meister MVP Wednesday, August 27, 2014 2:30 PM not VSTO-technology related
    Tuesday, August 26, 2014 1:29 PM

Answers

  • Hi,

    In fact, VSTO has no support for creating Excel UDFs. UDFs still require that they are written in VBA. The reason is that the only way Office can execute external code (i.e. you add-in) is via COM. Even VSTO is still using the old IDTExtensibility2 COM interface underneath. IDTExtensibility2 is a COM interface that all add-ins for Microsoft Office applications must implement. For a workaround, you can create your UDFs in managed code and call them from VBA.

    But if the UDFs are written in managed code, I'm afraid it may be hard to set the description for arguments of the UDFs to make it display.

    If you want to display the description of the UDFs, I suggest you creating the UDFs with XLL add-in instead of VSTO add-in. In XLL add-in, you can register the function with help description about every argument and the function. Here is a link for your reference: Developing User-Defined Functions for Excel 2007 and Excel Services


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, August 27, 2014 9:36 AM
    Moderator

All replies

  • Hi,

    In fact, VSTO has no support for creating Excel UDFs. UDFs still require that they are written in VBA. The reason is that the only way Office can execute external code (i.e. you add-in) is via COM. Even VSTO is still using the old IDTExtensibility2 COM interface underneath. IDTExtensibility2 is a COM interface that all add-ins for Microsoft Office applications must implement. For a workaround, you can create your UDFs in managed code and call them from VBA.

    But if the UDFs are written in managed code, I'm afraid it may be hard to set the description for arguments of the UDFs to make it display.

    If you want to display the description of the UDFs, I suggest you creating the UDFs with XLL add-in instead of VSTO add-in. In XLL add-in, you can register the function with help description about every argument and the function. Here is a link for your reference: Developing User-Defined Functions for Excel 2007 and Excel Services


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, August 27, 2014 9:36 AM
    Moderator
  • Hi Mridul

    As Luna mentions, VSTO does not support UDFs. So I'm going to move your question to the Excel for Developers forum where you have a better chance of someone seeing the question that may have an idea for you...


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, August 27, 2014 2:29 PM
  • You might like to investigate Excel-DNA for making your .NET-based Excel add-ins. It supports adding descriptions and other function options using attributes in your code. So in C# you might write:

    [ExcelFunction(Description="My clever addition function")]
    public static double AddTheValues(double val1, double val2)
    {
        return val1 + val2;
    }

    (Similar code works in VB.NET or F#.)

    More information is on the Excel-DNA CodePlex site, and for questions the best place to ask is the Excel-DNA Google group.

    -Govert

    Excel-DNA - Free and easy .NET for Excel

    Friday, September 5, 2014 8:46 PM