Online-Help for an UDF

141 views
Skip to first unread message

Marco Born

unread,
Mar 7, 2024, 9:51:12 AM3/7/24
to Excel-DNA
Hello Forum,
I used ExcelDNA to creat a User-Defined-Function using the followin example syntax:

<ExcelFunction(Name:="UDF_Example", Description:="Description", Category:="UDF-Functions")>
Public Function UDF_Example(
<ExcelArgument(Name:="arg1", Description:="Description", AllowReference:=True)> arg1 As Integer,
<ExcelArgument(Name:="arg2", Description:="Description", AllowReference:=True)> arg2 As Integer) As Date

This works perfect. The only thing I need to know is how I can add or link a document with my Online Help to the link in the Function Wizard of Excel. Is this possible and how can I do this? Can I link to an external help file or do I provide the information within my addin?

Any help is appreciated.

Thanks a lot in advance,
M. Born

Govert van Drimmelen

unread,
Mar 7, 2024, 2:38:42 PM3/7/24
to Excel-DNA
Hi Marco,

There are two plans for adding help links:

* Add a url for your web-based help information in the ExcelFunction attribute:
<ExcelFunction(Name:="UDF_Example", Description:="Description", Category:="UDF-Functions", HelpTopic:="http://www.google.com")>

* Use the ExcelDnaDoc library (together with the HTML Help Workshop) to generate a .chm help file for your add-in.

-Govert

Marco Born

unread,
Mar 8, 2024, 2:57:03 AM3/8/24
to Excel-DNA
Thanks a lot, Govert. I'll try both ways and see which works better.

Marco Born

unread,
Mar 8, 2024, 6:38:04 AM3/8/24
to Excel-DNA
Hello Govert,
the first version was not working. I tried several ways, using absolute and relative Paths, with or without an anchor in my help file, with PDF,  HTML and MHTML-Files. It never worked. So I installed the ExcelDNA-Doc Nuget-package and used the CHM-file it generated. I included it as an ExcelFunction attribute: HelpTopic:="C:\path\FKGenDNA-AddIn.chm!1001"
Using the 1001 works, but how I can choose different anchors in the CHM file for each UDF in my file?

Thanks again,
Marco

Govert van Drimmelen

unread,
Mar 8, 2024, 7:24:48 AM3/8/24
to exce...@googlegroups.com

Hi Marco,

 

Do you mean the first option with a url does not navigate to that url?

You mean if you make it “http://google.com” that it doesn’t go there?

I don’t think you can point it to a help file, but just pages on a web site.

 

For the second option with ExcelDnaDoc, you’ll have to manage the help ids yourself, by putting unique ones in each HelpTopic.

Then the generated help file will be made with those topics.

 

-Govert

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/b39b6ecd-4c6c-46a5-9ffe-f6eb38b233b3n%40googlegroups.com.

Marco Born

unread,
Mar 8, 2024, 8:45:15 AM3/8/24
to Excel-DNA
Hello Govert,
my origional plan was to use an existing PDF/A-File as Online-Help. When I created it I marked each paragraph number with a textmark. I tried to use this file in HelpTopic, either with absolut or relative path, with and without the textmarks. I always got an error "Help file not found". So I created a html file from my PDF and tried the same, also a MHTM-file. Still the same error. That's why I now favor the way using the CHM file.

For my problem lets use the following scenario. I have 3 UFDs, named Function1, Function2 and Function3. Can I then make something like this?
HelpTopic:="C:\path\FKGenDNA-AddIn.chm!1"
HelpTopic:="C:\path\FKGenDNA-AddIn.chm!2"
HelpTopic:="C:\path\FKGenDNA-AddIn.chm!3"

Will the CHM generator detect the targets I added and put them into the CHM file so that Excel also can link them to the right, corresponding page?

Thanks again,
Marco

Govert van Drimmelen

unread,
Mar 8, 2024, 8:51:10 AM3/8/24
to exce...@googlegroups.com

Hi Marco,

 

For the Web url, you have to just give the url to the html content, you can’t point it to a help file and use that.

 

For the .chm file, Iyou should use just the .chm file name instead of the whole path, and I seem to think there was a reason for the ids to start at 1001.

So you’d have

HelpTopic:="FKGenDNA-AddIn.chm!1001"

HelpTopic:="FKGenDNA-AddIn.chm!1002"

HelpTopic:="FKGenDNA-AddIn.chm!1003"

 

Then it should generate a help file with the right topics, and link them  up correctly at runtime.

Marco Born

unread,
Mar 8, 2024, 9:24:01 AM3/8/24
to Excel-DNA
Hello Govert,
now it works like I wanted. Only just 1 more question:
In the readme file for the ExcelDNADoc-project (https://github.com/Excel-DNA/ExcelDnaDoc#readme-ov-file) you show C# and F# examples where you also use the options Summary, Example and Returns. Are they available in VB also? They don't appear in the IntelliSense and if I add them manually I get an errow.

Thank you very much
Marco

Govert van Drimmelen

unread,
Mar 8, 2024, 12:08:35 PM3/8/24
to exce...@googlegroups.com

Hi Marco,

 

You need to check the attributes from <ExcelFunction> to <ExcelFunctionDoc> and add an “Imports ExcelDna.Documentation” at the top of your file.

Marco Born

unread,
Mar 11, 2024, 4:53:13 AM3/11/24
to Excel-DNA
Thanks a lot, Govert. Now it works like I needed it.

Terry Aney

unread,
May 3, 2024, 10:42:20 AM5/3/24
to Excel-DNA
Govert,

So this is pretty recent thread.  I assume the ExcelDnaDoc repository/project still work properly the latest ExcelDna (.NET Core)?  Also, I assume you'll say 'personal preference', but just asking.  With everyone 'connected', would you make an online markdown version versus the old Help Compiler version?  Is that the reason MS abandoned it?

Even with mark down, I was thinking of supporting local documentation via a setting and during 'registration' simply change all the http:// to file://path... for help topics.

What's your opinion if you had to make a help file?

Govert van Drimmelen

unread,
May 3, 2024, 4:37:13 PM5/3/24
to exce...@googlegroups.com

Hi Terry,

 

Yes, ExcelDnaDoc should still work fine. I’d guess having a website with documentation that Google can index is the first thing to consider. Then you can also point the function help there. If you don’t want to publish what your add-in does, it’s a bit more problematic.

 

A single file .chm help file is pretty neat, though. We’ll probably add support for packing it into the single file .xll at some stage. I have no idea how many users find and use the Help link on the function wizard though – Excel doesn’t do that integration so well. I’m not sure it’s very important.

-Govert

Reply all
Reply to author
Forward
0 new messages