Workbooks Property Example

This example activates the workbook Book1.xls.

Workbooks("BOOK1").Activate

This example opens the workbook Large.xls.

Workbooks.Open filename:="LARGE.XLS"

This example saves changes to and closes all workbooks except the one that’s running the example.

For Each w In Workbooks
    If w.Name <> ThisWorkbook.Name Then
        w.Close savechanges:=True
    End If
Next w