8

I have used Excel Dna to create .NET xlls and use it in my addin and excel worksheet functions. I also use ExcelDnaPack.exe to package my xll.

I was wondering if excel dna supports, any ways to generate documentation for my library API's.

Thanks, Mani

Everything Matters
  • 2,482
  • 4
  • 23
  • 41

1 Answers1

14

Firstly, Excel-DNA allows you to integrate into the Excel function wizard with descriptions for the functions and the different arguments. These are added to your function using attributes:

[ExcelFunction(Category="My functions", Description="My useful function")] 
public static double MyFunc(
    [ExcelArgument(Description="is an important parameter.")] double param1,
    [ExcelArgument(Description="is unimportant.")] double param2)
{...}

The function wizard also allows a help link for each function.

If you have a help file, say in .chm format, you can tell Excel-DNA to hook up the help link like this:

[ExcelFunction(HelpTopic="MyHelp.chm!102")] 
public static double MyFunction() ...

How to get the help file? The C# or VB.NET compiler can generate an xml file from the xml /// comments in your code. This .xml file is processed by something like Sandcastle - here's a whole discussion on that part: Generating Documentation from C# XML Comments.

But Excel-DNA has nothing at the moment to automatically relate the functions and their topics. I'm not sure how hard it is to figure out the generated TopicIds from the Sandcastle output, or to set them from the code in the xml comment. If it's an issue, an automatic topic hookup or even a help generator tool might be a nice feature to add to Excel-DNA in future.

It is also common to add a ribbon to your Excel-DNA add-in with a button that displays a help file for the whole add-in.

Edit: There is now a user-contributed project that processes Excel-DNA to generate help files more easily. See https://github.com/mndrake/ExcelDnaDoc

Community
  • 1
  • 1
Govert
  • 15,501
  • 3
  • 56
  • 68