public void AutoOpen() { ExcelApplication = ExcelDnaUtil.Application as ExcelInterop.Application; // To avoid the Excel 'Save message' on Exit ExcelInterop.Workbook currentWorkbook = ExcelApplication.ActiveWorkbook; currentWorkbook.BeforeClose += (ref bool cancel) => { //int ii = System.Runtime.InteropServices.Marshal.ReleaseComObject(ETKExcel.ExcelApplication.Application); currentWorkbook.Saved = true; }; // Init the ETK Framework : mandatory before any uses of the framework ETKExcel.Init(ExcelApplication); }
public void AutoOpen() { Microsoft.Office.Interop.Excel.Application excelApplication = ExcelDnaUtil.Application as Microsoft.Office.Interop.Excel.Application; ETKExcel.Init(excelApplication); ComServer.DllRegisterServer(); //excelApplication.WorkbookOpen += (wb) => Register(wb); //excelApplication.WorkbookBeforeClose += (Workbook wb, ref bool cancel) => UnRegisterTlb(wb); if (excelApplication.ActiveWorkbook != null) { Register(excelApplication.ActiveWorkbook); } }
public void AutoOpen() { ExcelApplication = ExcelDnaUtil.Application as Excel.Application; // To avoid the Excel 'Save message' on Exit Excel.Workbook currentWorkbook = ExcelApplication.ActiveWorkbook; if (currentWorkbook != null) { currentWorkbook.BeforeClose += (ref bool cancel) => currentWorkbook.Saved = true; } // Init the ETK Framework : mandatory before any uses of the framework ETKExcel.Init(ExcelApplication); // Create, render and activate the dashboard view DashboardSheet.CreateAndActivateDashBoard(); }