SharpCell

FunctionCollection

public sealed class FunctionCollection

Namespace SharpCell · package SharpCell

The functions a workbook's formulas can call besides Excel's: add one with FunctionCollection.Add, and formulas calling it by name (ignoring case) use it from the next calculation on.

Properties

Names

public IReadOnlyCollection<string> Names { get; }

The names of the added functions, as they were added.

Methods

Add(string, Func<FunctionArguments, CellValue>, FunctionOptions)

public void Add(string name, Func<FunctionArguments, CellValue> body, FunctionOptions? options = null)

Adds a function. Formulas that call the name, and were #NAME? so far, are calculated again by the next Workbook.Recalculate. Calls written _xll.NAME(...) or _xludf.NAME(...), as Excel stores calls of add-in functions in files, find it too.

Parameters

Exceptions

Contains(string)

public bool Contains(string name)

Whether a function of that name was added, ignoring case.

Remove(string)

public bool Remove(string name)

Removes a function. Formulas calling it become #NAME? at the next Workbook.Recalculate.

Returns: Whether a function of that name was there.