コード例 #1
0
 private void Workbook_SheetDeactivate(object Sh)
 {
     if (ActiveSheet == null)
     {
         return;
     }
     ActiveSheet.Dispose();
     ActiveSheet = null;
 }
コード例 #2
0
        /// <summary>
        /// Create the controller while passing the Workbook to work on.
        /// </summary>
        /// <param name="workbook">Workbook to work on</param>
        public ExcelWorkbookController(Excel.Workbook workbook)
        {
            Workbook = workbook;
            // Add ActiveSheet controller
            ActiveSheet = new ExcelSheetController(Workbook.ActiveSheet);

            // Add event handlers
            Workbook.SheetActivate   += Workbook_SheetActivate;
            Workbook.SheetDeactivate += Workbook_SheetDeactivate;
        }
コード例 #3
0
 private void Workbook_SheetActivate(object Sh)
 {
     ActiveSheet = new ExcelSheetController((Excel.Worksheet)Sh);
 }