UDF with user help

A

Arne Hegefors

Hi! I have written several UDFs that other people use. They dont know it is a
UDF they just use it as a normal function in excel. is there any way to add
some help to the udf? they usually use the list of functions (insert
function) and there they have help for all non udf functions. Thanks alot!
 
N

Niek Otten

Look here:

http://www.jkp-ads.com/Articles/RegisterUDF00.htm

No easy stuff!

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| Hi! I have written several UDFs that other people use. They dont know it is a
| UDF they just use it as a normal function in excel. is there any way to add
| some help to the udf? they usually use the list of functions (insert
| function) and there they have help for all non udf functions. Thanks alot!
 
P

Peter T

Depends to what extent you want to go. The method as referred to by Niek is
excellent though, as he says, not simple.

Something quick and simple that you could do, although far from complete, is
to add a description that can be viewed after user finds your UDF in the
"User Defined" category -

Press F2 Object Browser
In libraries select your project
In classes select your module that contains your UDF(s)
In members select your UDF
right click, properties
enter your text that will appear in the function wizard.

You can also link your own help file, though that really is a lot more work
if you've not done it before.

Regards,
Peter T
 
B

Bill Renaud

<<Something quick and simple that you could do, although far from complete,
is to add a description that can be viewed after user finds your UDF in the
"User Defined" category>>

Hopefully this feature works in later versions of Excel! In Excel 2000
(SP-3), Excel just throws the Description field away after the programmer
enters it in the Member Options dialog box!
 
P

Peter T

It works fine in my Excel 2000. There is another way though.
Export the module and open from file in a text editor.

After the function name include the description attribute, eg

Function foo(arg)
Attribute foo.VB_Description = "first line of info\r\nSecond line more info"
' your code
End Function

The \r\n in the string will force a new line (max 2 lines in xl97, 3 in
later versions) or just allow to wrap.
Save and import back into your project (drag from file) after removing the
old bas.

Regards,
Peter T
 
B

Bill Renaud

<<Export the module and open from file in a text editor.

After the function name include the description attribute, eg

Function foo(arg)
Attribute foo.VB_Description = "first line of info\r\nSecond line more
info"
' your code
End Function

The \r\n in the string will force a new line (max 2 lines in xl97, 3 in
later versions) or just allow to wrap. Save and import back into your
project (drag from file) after removing the old bas.>>

Great tip! I'll definitely save this one for future use! I don't know why
setting the Description doesn't work in my installation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top