NewWorkbook Event [Excel 2003 VBA Language Reference]

Occurs when a new workbook is created.

Private Subobject**_NewWorkbook(ByValWbAs Workbook)**

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

Wb The new workbook.

Example

This example arranges open windows when a new workbook is created.

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

Applies to | Application Object