RemoveCustomFunction

RemoveCustomFunction(sName) → { boolean }

Removes a custom function.

Parameters:

Name Type Description
sName string

The name of a custom function.

Returns:

Type
boolean

Example

Copy code
builder.CreateFile("xlsx");
/**
* Calculates the sum of the specified numbers.
* @customfunction
* @nameLocale {fr:Ajouter | es:Añadir}
* @param {number} first The first number (required).
* @param {number} [second] The second number (optional).
* @returns {number} The sum of the numbers.
*/
Api.AddCustomFunction (function add (first, second) {
    if (second === null) {
        second = 0;
    }
    return first + second;
})
var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A1").SetValue("=ADD(1, 2)");
Api.RemoveCustomFunction("add");
oWorksheet.GetRange("A3").SetValue("The ADD custom function was removed.");
builder.SaveFile("xlsx", "RemoveCustomFunction.xlsx");
builder.CloseFile();

Resulting document