WindowActivate Event

Applies To

Application object, Workbook object.

Description

Occurs when any workbook window is activated.

Syntax

Private Sub object_WindowActivate(ByVal Wb As Excel.Workbook, ByVal Wn As
úExcel.Window)

object Application or Workbook.

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

Wn The activated window.

See Also

Activate event, Deactivate event, SheetActivate event, SheetDeactivate event, WindowDeactivate event, WorkbookActivate event, WorkbookDeactivate event.

Example

This example maximizes any workbook window when it's activated.

Private Sub Workbook_WindowActivate(ByVal Wn As Excel.Window)
    Wn.WindowState = xlMaximized
End Sub