Application


WorkbookBeforeClose

This creates an event handler for the WorkbookBeforeClose application level event.

public void Event_Application_WorkbookBeforeClose(Excel.Workbook workbook, ref bool Cancel) 
{
}
gApplicationExcel.WorkbookBeforeClose += Event_Application_WorkbookBeforeClose;

'VB.Net Equivalent
Addhandler gApplicationExcel.WorkbookBeforeClose _
   AddressOf Event_Application_WorkbookBeforeClose

WorkbookDeactivate

This creates an event handler for the WorkbookDeactivate application level event.

public void Event_Application_WorkbookDeactivate(Excel.Workbook workbook) 
{
}
gApplicationExcel.WorkbookDeactivate += Event_Application_WorkbookDeactivate;

'VB.Net Equivalent
Addhandler gApplicationExcel.WorkbookDeactivate _
   AddressOf Event_Application_WorkbookDeactivate

WorkbookOpen

This creates an event handler for the WorkbookOpen application level event.

public void Event_Application_WorkbookOpen(Excel.Workbook workbook) 
{
}
gApplicationExcel.WorkbookOpen += Event_Application_WorkbookOpen;

'VB.Net Equivalent
Addhandler gApplicationExcel.WorkbookOpen _
   AddressOf Event_Application_WorkbookOpen

NewWorkbook

NewWorkbook is the name of both a property and an event.

public void Event_Application_NewWorkbook(Excel.Workbook workbook) 
{
}
((Excel.AppEvents_Event)gApplicationExcel).NewWorkbook +=
   new Excel.AppEvents_NewWorkbookEventHandler(Event_Application_NewWorkbook);

'VB.Net Equivalent
Addhandler CType(gApplicationExcel, Excel.AppEvents_Event).NewWorkbook _
   AddressOf Event_Application_NewWorkbook


© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext