Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

WorkbookBase.WindowDeactivate Event

Occurs when any workbook window is deactivated.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

public event WorkbookEvents_WindowDeactivateEventHandler WindowDeactivate

The following code example demonstrates a handler for the WindowDeactivate event. The event handler minimizes the workbook window that was deactivated.

This example is for a document-level customization.

private void WorkbookWindowDeactivate()
    this.WindowDeactivate +=
        new Excel.WorkbookEvents_WindowDeactivateEventHandler(

private void ThisWorkbook_WindowDeactivate(Excel.Window Wn)
    Wn.WindowState = Excel.XlWindowState.xlMinimized;

© 2015 Microsoft