Skip to main content

Application.ActiveWorkbook property

Table of contents
  1. Syntax
  2. Example

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.

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

This example displays the path of the active workbook.

MsgBox "The path of the active workbook is " & ActiveWorkbook.path

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>