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 microsoft.office.tools.excel.dll)

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(
        ThisWorkbook_WindowActivate);
}

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

Show:
© 2016 Microsoft