WindowDeactivate Event [Excel 2003 VBA Language Reference]

Occurs when any workbook window is deactivated.

Private Subobject**_WindowDeactivate(ByValWbAs Excel.Workbook**, ByValWnAs Excel.Window)

objectApplication or Workbook. For more information about using events with the Application object, see Using Events with the Application Object .

Wb Used only with the Application object. The workbook displayed in the deactivated window.

Wn The deactivated window.

Example

This example minimizes any workbook window when it's deactivated.

Private Sub Workbook_WindowDeactivate(ByVal Wn As Excel.Window)
    Wn.WindowState = xlMinimized
End Sub

Applies to | Application Object | Workbook Object

See Also | Activate Method | Deactivate Event | SheetActivate Event | SheetDeactivate Event | WindowActivate Event | WorkbookActivate Event | WorkbookDeactivate Event