Application.ActiveWorkbook property (Excel)

Returns a Workbook object that represents the workbook in the active window (the window on top). Returns Nothing if there are no windows open or if either the Info window or the Clipboard window is the active window. Read-only.

Note

The document in the active Protected View window cannot be accessed by using this property. Instead, use the Workbook property of the ProtectedViewWindow object.

Syntax

expression.ActiveWorkbook

expression A variable that represents an Application object.

Example

This example displays the name of the active workbook.

MsgBox "The name of the active workbook is " & ActiveWorkbook.Name

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.