ActiveX
To create and use a custom function
At run time,
- If you want to define a custom function with a specified number of parameters, call the AddCustomFunction method.
- If you want to define a custom function with a variable number of parameters, call the AddCustomFunctionExt method.
-
Define the response to the CustomFunction event.
Use the CFGetParamInfo method to return information about the custom function's parameters. Use the CFGetCellParam, CFGetDoubleParam, CFGetDoubleParamExt, CFGetLongParam, CFGetParamInfo, CFGetRangeParam, and CFGetStringParam methods to return the values for the parameters. Use the CFSetResult method to return the value of the function.
- Use the custom name in formulas as you would other operators.