WorkbookActivate Event

Applies To

Application object.

Description

Occurs when any workbook is activated.

Syntax

Private Sub app_WorkbookActivate(ByVal Wb As Workbook)

app An object of type Application declared with events in a class module.

Wb The activated workbook.

See Also

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

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