View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Subodh Subodh is offline
external usenet poster
 
Posts: 99
Default Addin UDF Registration/Declaration

On May 2, 5:46*pm, "Peter T" <peter_t@discussions wrote:
"Subodh" wrote in message

news:83b70cf6-d74a-4d50-97ad-

Its great to have that addin.
But, I am thinking some modifications in the addin
So, that if there are less number of functions (not 200 atleast around
5 lets say) then
i need to make all the code within the module
Also, that there should not be anything in the sheets.
The code whould include all that within it.
Thanks in advance.


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."

Regards,
Peter T


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

Sub ProcessRange(FuncListInclHeader As Range, bRegister As Boolean)

Dim r&, c&
Dim vArgs
vArgs = Array(Empty, _
"dllname*", "dllproc*", "argtype*", "funtext*",
"argtext*", _
"mactype*", "catname*", "keytext*", "hlppath*",
"funhelp*", _
"arghelp*")

With FuncListInclHeader
' With .Rows(1)
For c = 1 To 30
If Not LCase(.Columns(c)) Like
vArgs(Application.Min(c, 11)) Then
MsgBox "Range Headers invalid or missing"
Exit Sub
End If
Next
' End With


For r = 2 To 2 '.Rows.Count
' With .Rows(r)
' If Len(.Columns(4)) 0 Then
'Clear the data
ClearData
'Assign the properties
DllName = "user32.dll"
' .Columns (1)
DllProc = "CharNextA" '.Columns(2)
ArgType = P# '.Columns(3)
FunText = "MY FUN NAME" '.Columns(4)
ArgText = "MY ARG TYPE" '.Columns(5)
MacType = 1 '.Columns(6)
CatName = "UDF Helper DEMO" '.Columns(7)
KeyText = "" '.Columns (8)
HlpPath = "" '.Columns(9)
FunHelp = "This is just a trial" '.Columns(10)
' For c = 1 To 20
' ArgHelp(c) = .Columns(10 + c)
' Next
If bRegister Then
'Register
RegisterFunction
Else
'Unregister
UnregisterFunction
End If
End If
End With
Next
End With

This was a trial for just one function declaration
But it didn't work
any help would be appreciated.
Thanks in advance.

End Sub