Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doing Documentation Using Excel Dna

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

like image 341
Everything Matters Avatar asked Nov 17 '11 18:11

Everything Matters


People also ask

How does excel-DNA work?

Excel-DNA is an independent project to integrate . NET into Excel. With Excel-DNA you can make native (. xll) add-ins for Excel using C#, Visual Basic.NET or F#, providing high-performance user-defined functions (UDFs), custom ribbon interfaces and more.


1 Answers

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

like image 164
Govert Avatar answered Sep 25 '22 05:09

Govert