Add help to “No help available” Excel, VBA , User defined functions

家住魔仙堡 提交于 2019-12-19 11:30:16

问题


I was trying to add some help to my user-defined function(UDF) in Excel, written using VBA(Visual Basic for Applications). I know how to add a description.Any idea how I can add help at the blue link "Help on this function" and not have it lead to a MsgBox that reads "No help available" ?


回答1:


You have to first create a help file. You can then use Application.MacroOptions to attach the help file to the function

For example

Application.MacroOptions Macro:="MyFunction", _
                         Category:="My Custom Category", _
                         HelpFile:="C:\MyHelp.chm", _
                         HelpContextID:=1

EDIT: Adding More Information

I usually use Help and Manual6 to create my help files for my projects. Here is one example that I created for the above example. And when I click on the "Help On this Function", see what do I get...

DISCLAIMER: I am not connected to Help and Manual6 in any way but I like their product (It is not free). You might just find a freeware on the web which can make chm files for you so I leave the decision with you on how you choose to make the help file.



来源:https://stackoverflow.com/questions/10987037/add-help-to-no-help-available-excel-vba-user-defined-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!