ExcelDna and Help files generated from ExcelDnaDoc

Jan 22, 2014 at 2:29 PM
I apologize for double posting this to both the ExcelDnaDoc issues list and this discussion group but I feel that this discussion group has more traffic.

Is there any magic required to get Excel to go to the requested help topic?

When I click "Help on this topic" in the function wizard it just does nothing.
No "Help topic not found" error or anything. It just fails silently.
I have added ExcelFunctionDoc annotations to my methods and have used the program to generate a chm file.

When open the .hpp file it looks like the topics are set up correctly in the alias section...

Topic1001 = myFunc,htm


define Topic1001 1001

And in my annotation I am referencing the same topic Id.
[ExcelFunctionDoc( Name="myFunc", HelpTopic="MyHelp.chm!1001")] as the topic.

Any information would be most helpful.

Jan 24, 2014 at 8:39 AM
Hi Harley,
  • Is your MyHelp.chm file located in the same directory as your .xll file?
  • Can you try with the attribute ExcelFunction instead of ExcelFunctionDoc?
[ExcelFunction( Name="myFunc", HelpTopic="MyHelp.chm!1001")] 
Jan 24, 2014 at 9:15 PM
Edited Jan 24, 2014 at 9:16 PM
  • Is the chm file is located in the same directory as the XLL file.
    • Just to make sure that it was finding the file or to see what would happen I change one function to use MyHelp_foo.chm which doesn't exist. When I click "help on this function" on the one where the file doesn't exist the Microsoft office help window comes up with the default "Getting started with Excel 2010" page.
  • I replaced the attribute with ExcelFunction and see the same behavior.
    • I didn't think that this was going to be the cause since I put a break point in the registration code and saw it was still passing the HelpTopic through.
I may switch to URLs since that worked for me... additionally I already have web documentation for my add-in that we paid a consultant to write so that would work nicely for me. What do you think of supporting file:// in addition to http:// in the registration code? I am not sure if Excel would support that or just balk. I would want the option to set the base either dynamically or as a relative to the .xll location though.
Jan 24, 2014 at 10:30 PM
Hi Harley,

I've tried to see whether Excel supports file:// urls, and couldn't make it work at all. In any event, Excel-DNA passes through any http://, https:// or file:// HelpTopic to Excel (after appending "!0" if it's not there). For other HelpTopics, Excel-DNA will add the directory where the .xll is if the HelpTopic is not a rooted path (with a drive letter).

I've not tried the ExcelDnaDoc tool, so can't tell whether something might be wrong with your help file, or how the attributes are processed.

Jan 26, 2014 at 1:39 AM
Well I saw that it passed through the http:// and https:// ones and the addition of the !0 (in the version that I pulled down.)
I didn't see file:// which is why I brought it up.

I figured it out thanks to a sample from mndrake. The problem was basically between the keyboard and the chair.

I was experimenting with trying to use some numeric topics and some textual.

For example:
[ExcelFunctionDoc( Name="myOtherFunc", HelpTopic="MyHelp.chm!myOtherFunc.htm")]

The textual ones were screwing up the look-ups. I changed those to be numeric and it worked.
Thanks for all your help.
Jan 27, 2014 at 8:35 PM
Hi Harley,

I added the file:// bit in more recent check-ins, but could never get it to work.

I think Excel only supports the numeric topics.

Jan 28, 2014 at 5:13 AM

I took a cue from you and added a sample c#/f# add-in to the ExcelDnaDoc project in case someone else needs more than just the snippets included in the readme.

I am not doing anything special to the topic id's internally. The ExcelFunctionDoc inherits from ExcelFunction with just a few more properties added that can used in the generated documentation. (https://github.com/mndrake/ExcelDnaDoc/blob/master/src/ExcelDna.Documentation/ExcelFunctionDocAttribute.cs)

The help project file is generated via Razor templates using the topic id's included in the add-ins ExcelCommand/ExcelFunction/ExcelFunctionDoc properties. (https://github.com/mndrake/ExcelDnaDoc/blob/master/src/ExcelDnaDoc/HelpContent/ProjectFileTemplate.cshtml)

I wish there was a way to generate .chm files without the HTML workshop, or at least include it in a solution. If that was possible then self contained generated documentation could potentially integrated into Excel-DNA packing utility.