When I was writing this post to report I failed and gave up on getting VBA custom function work on descriptions of func and args, in order to write and reproduce the problem again I did a few more experiments and finally figured out why it didn’t work before or how I misused it.
Here is the code I use for creating docs for a dummy custom VBA function:
Function addNum(num1 As Double, num2 As Double) As Double
addNum = num1 + num2
End Function
Sub doc_addNum()
Dim Arg(1 To 2) As String
Arg(1) = "number one"
Arg(2) = "number two"
Application.MacroOptions Macro:="addNum", Description:="do it one last time to add two numbers with args", _
ArgumentDescriptions:=Arg()
End Sub
Put it simply, to make docs (description for func and args) work, I just have to run this macro first which I had wrongly assumed it would run whenever the function is run, and spent too much time worrying about where is wrong with my codes and Excel settings.
Although the docs is working now, I do have an error when running the macro code.
Do you know what’s wrong with this line of code? @Moody