Class FunctionRepository
This class provides methods for accessing/modifying VBA Functions.
Implements
Inherited Members
Namespace: OfficeOpenXml.FormulaParsing.Excel.Functions
Assembly: EPPlus.dll
Syntax
public class FunctionRepository : IFunctionNameProvider
Properties
FunctionNames
Returns the names of all implemented functions.
Declaration
public IEnumerable<string> FunctionNames { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
NamespaceFunctions
Contains all functions that needs a namespace prefix in Excel. For example: The Filter function must have the prefix "_xlfn._xlws."
Declaration
public Dictionary<string, string> NamespaceFunctions { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, string> |
Methods
AddOrReplaceFunction(string, ExcelFunction)
Adds or replaces a function.
Declaration
public void AddOrReplaceFunction(string functionName, ExcelFunction functionImpl)
Parameters
| Type | Name | Description |
|---|---|---|
| string | functionName | Case-insensitive name of the function that should be added or replaced. |
| ExcelFunction | functionImpl | An implementation of an ExcelFunction. |
Clear()
Removes all functions from the repository
Declaration
public virtual void Clear()
Create()
Create repository
Declaration
public static FunctionRepository Create()
Returns
| Type | Description |
|---|---|
| FunctionRepository |
GetFunction(string)
Get function
Declaration
public virtual ExcelFunction GetFunction(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Returns
| Type | Description |
|---|---|
| ExcelFunction |
IsFunctionName(string)
Returns true if the the supplied name exists in the repository.
Declaration
public bool IsFunctionName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Returns
| Type | Description |
|---|---|
| bool |
LoadModule(IFunctionModule)
Loads a module of ExcelFunctions to the function repository.
Declaration
public virtual void LoadModule(IFunctionModule module)
Parameters
| Type | Name | Description |
|---|---|---|
| IFunctionModule | module | A IFunctionModule that can be used for adding functions and custom function compilers. |