Skip to content

UDF in-sheet IntelliSense #27

@govert

Description

@govert

I develop Excel-DNA, an Excel integration project similar to excel-d, but for the .NET languages.

One of the extensions I've made is an add-in that allows in-sheet IntelliSense for UDF functions similar to that displayed for the built-in Excel functions while typing a formula. The IntelliSense extension supports integration by other types of add-ins, not only those made with Excel-DNA. In particular, functions defined in VBA or through the native C API using any other language can also display their function descriptions through the Excel-DNA IntelliSense add-in.

For .xll-based add-ins like those made with excel-d, there are two integration options:

  • Next to MyAddIn.xll, place a file called MyAddIn.xll.intellisense.xml with some xml markup providing the function and argument descriptions. The xml content will be something like this
<IntelliSense xmlns="http://schemas.excel-dna.net/intellisense/1.0">
  <FunctionInfo>
   <Function Name="MyDLanguageFunction" Description="A function implemented in D"
              HelpTopic="http://www.bing.com" >
      <Argument Name="FirstArg" Description="Whatever you want to put in here" />
      <Argument Name="AnotherArg" Description="Actually the second arg" />
    </Function>
    <Function Name="AnotherFunction" Description="A function described in XML"
              HelpTopic="http://www.bing.com" >
      <Argument Name="FirstArg" Description="Whatever you want to put in here" />
      <Argument Name="AnotherArg" Description="Actually the second arg" />
    </Function>
  </FunctionInfo>
</IntelliSense>
  • Alternatively, you can create a special (hidden) function in the .xll add-in which is registered as a UDF with Excel and returns an array with the function registration information, as used in the xlfRegister calls to Excel. The registered function name will include a magic Guid that is derived from the .xll path - that's ow the IntelliSense extension find your info function. Details of the magic Guid, format of the table you should return and a sample implementation of the Guid calculation can be found in the RegistrationInfoGuid project.

Finally, after choosing either of the above options, you need to download the ExcelDna.IntelliSense.xll add-in from the GitHub Releases tab. This is the small add-in that provides the actual UI extensions. The (single-file) add-in can be renamed if you want to, and multiple instances (for example those embedded in other Excel-DNA add-ins) will negotiate among themselves to ensure that only one instance (with the latest version) will be active.

If you give the IntelliSense add-in a try and run into any issues with the D integration, I'd be very happy to help.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions