Clear argument descriptions of UDF using MacroOptions method

dashali

New Member
Joined
Jul 29, 2022
Messages
4
Office Version
  1. 2010
Platform
  1. Windows
I used MacroOptions method to add descriptions for UDF. How to clear/unregister UDF descriptions?
My code:
Application.MacroOptions Macro:=Fname, Description:=Empty, Category:=Empty, ArgumentDescriptions:=Empty
Because of ArgumentDescriptions:=Empty , the code makes error 1004.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Welcome to the Board!

I have never used that before, but I am pretty sure you cannot use "Empty".
Have you tried "" instead?, i.e.
VBA Code:
Application.MacroOptions Macro:=Fname, Description:="", Category:="", ArgumentDescriptions:=""
 
Upvote 0
This code works:
Application.MacroOptions Macro:=Fname, Description:=Empty, Category:=Empty
But these codes doesn't work:
Application.MacroOptions Macro:=Fname, Description:=Empty, Category:=Empty, ArgumentDescriptions:=Empty
Application.MacroOptions Macro:=Fname, Description:="", Category:="", ArgumentDescriptions:=""
 
Upvote 0
How about this? Does this work?
VBA Code:
Application.MacroOptions Macro:=Fname, Description:="", Category:=""
 
Upvote 0
You can test the code, as well: (see UnregisterOptions)
Function SUBSTITUEX(T As String, ByVal elements_a_remplacer As Variant, Optional ByVal elements_de_remplacement As Variant = "")
Dim I&, Q$

'conversion en variable tableau si Typerange
elements_a_remplacer = elements_a_remplacer
elements_de_remplacement = elements_de_remplacement

'conversion en array 1 dimension selon le type d'array injecté
Select Case GetdimensionTypeArray(elements_a_remplacer)
Case "vertical": elements_a_remplacer = Application.Transpose(elements_a_remplacer):
Case "ligne": elements_a_remplacer = Application.Index(elements_a_remplacer, 1, 0)
End Select

Select Case GetdimensionTypeArray(elements_de_remplacement)
Case "vertical": elements_de_remplacement = Application.Transpose(elements_de_remplacement)
Case "ligne": elements_de_remplacement = Application.Index(elements_de_remplacement, 1, 0)
End Select

For I = LBound(elements_a_remplacer) To UBound(elements_a_remplacer)
If IsArray(elements_de_remplacement) Then
If UBound(elements_de_remplacement) <> UBound(elements_de_remplacement) Then SUBSTITUEX = "notEqualBoundary": Exit Function
Q = elements_de_remplacement(I)
Else: Q = elements_de_remplacement
End If
T = Replace(T, elements_a_remplacer(I), Q)
Next
SUBSTITUEX = T
End Function

Function GetdimensionTypeArray(T)
'Fonction pour determiner le type de dimensionnement de la variable injectée(T)
'patricktoulon
Dim Tx, x&, Z, x2, z2&
z2 = UBound(T): If z2 = 0 Then x2 = Z + 1: x = x2 Else x = Z: x2 = x
Z = Switch(z2 = 1, "ligne", TypeName(Application.Index(T, z2, 2)) <> "Error", "tableau", x = x2, "vertical", x < x2 Or x > 1, "array")
If Z = "vertical" And TypeName(Application.Index(T, z2, 1)) = "Error" Then Z = "array"
GetdimensionTypeArray = Z
End Function


Sub UnregisterOptions()
Application.MacroOptions Macro:="SUBSTITUEX", Description:=Empty, ArgumentDescriptions:=Empty, Category:=Empty
End Sub

Sub registerOptions()
Dim Funct_description As String, argumtsArray

'(max 255 caracteres)
Funct_description = "Fonction SUBSTITUEX" & vbCrLf & _
"Cette fonction sert a substituer" & vbCrLf & _
"Array;une chaine/carateres" & vbCrLf & " par" & vbCrLf & _
"Array;une chaine/carateres ou un melange" & vbCrLf & _
"Creted by patricktoulon"

'Description des arguments de la fonction
argumtsArray = Array("string:chaine à traiter", _
"array de chaine ou de carateres à substituer ((peut etre une Range))", _
"array de chaine ou de caratères de remplacecement ((peut etre une Range))")


'appel la sub pour enregistrer
Application.MacroOptions Macro:="SUBSTITUEX", _
Description:=Mid(Funct_description, 1, 255), _
ArgumentDescriptions:=argumtsArray, _
Category:="personnalisée"
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top