void DefineCustomFunctions()
        {
            // Open Excel Add-In file in the background.
            excelHelper = new ExcelAppHelper();

            if (!excelHelper.Initialize(path + @"\AddIns\SphereMassAddIn.xlam"))
            {
                MessageBox.Show("Can not start Excel application");
                return;
            }

            // Specify a new instance of the custom function and add it to the collection of custom functions in a workbook.
            AddInFunction function = new AddInFunction("SPHEREMASS", excelHelper);

            spreadsheetControl1.Document.CustomFunctions.Add(function);
        }
 public AddInFunction(string name, ExcelAppHelper excelApp)
 {
     this.name     = name;
     this.excelApp = excelApp;
 }