//Create an ExcelApplication object
ExcelApplication xla = new ExcelApplication();
//Open a workbook containing formulas
Workbook wb = xla.Open("FormulasWorkbook.xlsx);
// Create andan instance of the custom function implementation
IFunction myCustomFunction = new MyCustomFunction();
//Register the custom function
wb.RegisterCustomFunction("MyCustomFunction", myCustomFunction); |