Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Function parameter description

Hi all!

I work with Excel functions and I want write descpription for the function
and for its parameter (like the Excel's Sum() function).
For the function I use:

public function myFunct(p1 as string) as string
Attribute myFunct.vb_Description="Description of myFunct"
' ...

myFunct = "Hello!"
end function

How it's possible to write the description for p1?

Thanx in advance!

Davids


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Function parameter description

There are a couple of ways, one not too robust, one that requires a dll.

The not too robust way, suggested by Laurent Longre and working for two
parameters is :-
Const Lib = """c:\windows\system\user32.dl*l"""
Option Base 1


Private Function Multiply(N1 As Double, N2 As Double) As Double
Multiply = N1 * N2
End Function


'=============================*=============


Private Function Divide(N1 As Double, N2 As Double) As Double
Divide = N1 / N2
End Function


'=============================*=============


Sub Auto_open()


Register "DIVIDE", 3, "Numerator,Divisor", 1, "Division", _
"Divides two numbers", """Numerator"",""Divisor """, "CharPrevA"
Register "MULTIPLY", 3, "Number1,Number2", 1, "Multiplication", _
"Multiplies two numbers", """First number"",""Second number """, _
"CharNextA"


End Sub


'=============================*=============


Sub Register(FunctionName As String, NbArgs As Integer, _
Args As String, MacroType As Integer, Category As String, _
Descr As String, DescrArgs As String, FLib As String)


Application.ExecuteExcel4Macro _
"REGISTER(" & Lib & ",""" & FLib & """,""" & String(NbArgs, "P") _
& """,""" & FunctionName & """,""" & Args & """," & MacroType _
& ",""" & Category & """,,,""" & Descr & """," & DescrArgs & ")"


End Sub


'=============================*=============


Sub Auto_close()


Dim FName, FLib
Dim I As Integer
FName = Array("DIVIDE", "MULTIPLY")
FLib = Array("CharPrevA", "CharNextA")
For I = 1 To 2
With Application
.ExecuteExcel4Macro "UNREGISTER(" & FName(I) & ")"
.ExecuteExcel4Macro "REGISTER(" & Lib & _
",""CharPrevA"",""P"",""" & FName(I) & """,,0)"
.ExecuteExcel4Macro "UNREGISTER(" & FName(I) & ")"
End With
Next


End Sub




The dll solution:
Also from Laurent Longre, you use the FUNCUSTOMIZE utility .Get it at
http://longre.free.fr/english/

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Davids" wrote in message
...
Hi all!

I work with Excel functions and I want write descpription for the function
and for its parameter (like the Excel's Sum() function).
For the function I use:

public function myFunct(p1 as string) as string
Attribute myFunct.vb_Description="Description of myFunct"
' ...

myFunct = "Hello!"
end function

How it's possible to write the description for p1?

Thanx in advance!

Davids




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Function parameter description

Thank you, Bob...

The first way doesn't work on my PC, the second yes!
Many thanx!

Davids


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameter description Davids Excel Worksheet Functions 1 May 2nd 05 12:09 PM
Function parameter description Christine[_5_] Excel Programming 1 November 27th 03 06:08 PM
access function description from c angelique Excel Programming 0 October 29th 03 03:56 PM
access function description from c++ Angelique[_2_] Excel Programming 0 October 29th 03 03:55 PM
Macro Questions: Returning multiple results, description of parameter syntax et al. Frederik Romanov Excel Programming 1 July 17th 03 04:42 PM


All times are GMT +1. The time now is 03:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"