"Subodh" <
[email protected]> wrote in message
Subodh,
I assume you are talking about Laurant's addin. I've just had a quick look
at his latest version.
I'm not sure if I understand your question correctly. However you do not
need to include any text data in cells. You can simply supply an array
between 7 to 26 columns depending on maximum number of function arguments,
and with rows to cater for the number of functions.
Andrew,
Looks like I can include more than 255 characters in total, I'm surprised
and not sure what's going on there. Yet that even contradicts the help
file:
"- The total length of all string fields (Function name, argument names,
descriptions.) can't contain more than 255 characters. If it exceeds this
limit, the last strings will be truncated in the function wizard."
Dear Peter,
I tried to modify the code of Laurant's addin in the first had
so that nothing for the UDF Registration should be in the sheet
and everything of the code should be in the code (class modules and
modules)
For that i thought that modificaiton was necessary in the class module
and more specific in the Sub ProcessRange
So, i tried to replace the sheet references by an array representation
and mind code looks like this
=======================
Referring to Laurant's FunCustomize_Demo.xla
First run Workbook_AddinUninstall to remove the customized function
arguments
add the following in a normal module
Function GetAllArgs(arrArgs())
Dim i As Long, j
Dim arr()
Const cFUNCS As Long = 2 ' << change to suit
Const cMAXARGS As Long = 3 ' << change to suit
ReDim arrArgs(1 To cFUNCS, 1 To 6 + cMAXARGS)
For i = 1 To cFUNCS
Call GetArg(i, arr)
For j = 0 To UBound(arr)
arrArgs(i, j + 1) = arr(j)
Next
Next
End Function
Function GetArg(idx As Long, arr())
Dim varEmpty
'' this is the first 2 of 4 sets for function descriptions,
' add the other two in the as Cas2 3 & 4
' don't forget to change cFUNCS to 4 and maybe cMAXARGS
Select Case idx
Case 1
arr = Array("HYPOTENUSE", "Side 1,Side 2", varEmpty, _
"FunCustomize Demo", varEmpty, _
"Returns the length of an hypotenuse", _
"Length of the first side", _
"Length of the second side")
Case 2
arr = Array("RANDOM", "Min,Max,Volatility", varEmpty, _
"FunCustomize Demo", varEmpty, _
"Returns a random number between two integers", _
"Min. random number. If MIN>MAX, returns #NUM!", _
"Max. random number. If MAX<MIN, returns #NUM!", _
"Optional. If TRUE or omitted, " & _
"this function is volatile, otherwise it is static")
End Select
End Function
and amend the following
Sub Aut
pen()
Dim arrArgs() ' < new
GetAllArgs arrArgs ' < new
comment
' ' Run [FunCustomize], ThisWorkbook.Name, shFunctions.Range("A2:Z5")
add
Run [FunCustomize], ThisWorkbook.Name, arrArgs ' < new
Private Sub Workbook_AddinUninstall()
Dim arrArgs()
GetAllArgs arrArgs
If Run([FuncDelete], arrArgs) = -1 Then _
ExecuteExcel4Macro "UNREGISTER(""" & Me.Path & "\funcustomize.dll"&
""")"
End Sub
Must admit it took me a while to get it to work, eventually the trick was
the use of varEmpty for missing arg's instead of "" or entirely empty (which
becomes Missing)
Regards,
Peter T- Hide quoted text -
- Show quoted text -