Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDF in-sheet IntelliSense #27

Open
govert opened this issue Aug 11, 2017 · 4 comments
Open

UDF in-sheet IntelliSense #27

govert opened this issue Aug 11, 2017 · 4 comments

Comments

@govert
Copy link

govert commented Aug 11, 2017

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.

@Laeeth
Copy link
Contributor

Laeeth commented Aug 12, 2017

Hi govert. Thanks for getting in touch. I'm a little familiar with Excel-DNA. Appreciate your thoughts. @atilaneves could we work on integrating these optionally ? Maybe ExcelDNA is defined or not as a version, and if it is the program that generates the .def file also creates the .intellisense.xml file. Or, it may be cleaner to go with the second option - just return the function registration info via special hidden function.

@atilaneves
Copy link
Collaborator

@Laeeth This can definitely be done.

@Laeeth
Copy link
Contributor

Laeeth commented Aug 17, 2017

@govert Thanks for letting me know. We will do this, but it might take a little time.

@Laeeth
Copy link
Contributor

Laeeth commented Sep 24, 2017

@atilaneves ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants