WindowActivate Event
The document is archived and information here might be outdated

Workbook.WindowActivate Event

Occurs when any workbook window is activated.

Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in

public event WorkbookEvents_WindowActivateEventHandler WindowActivate

The following code example demonstrates a handler for the WindowActivate event. The event handler maximizes the workbook window that was activated.

private void WorkbookWindowActivate()
    this.WindowActivate +=
        new Excel.WorkbookEvents_WindowActivateEventHandler(

private void ThisWorkbook_WindowActivate(Excel.Window Wn)
    Wn.WindowState = Excel.XlWindowState.xlMaximized;

© 2016 Microsoft