WorkbookActivate Event [Excel 2003 VBA Language Reference]

Occurs when any workbook is activated.

Private Subapp**_WorkbookActivate(ByValWbAs Workbook)**

app An object of type Application declared with events in a class module. For more information, see Using Events with the Application Object .

Wb The activated workbook.

Example

This example arranges open windows when a workbook is activated.

Private Sub App_WorkbookActivate(ByVal Wb As Workbook)
    Application.Windows.Arrange xlArrangeStyleTiled
End Sub

Applies to | Application Object

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