示例#1
0
        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);
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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();
        }