Application.ActiveWorkbook Property (Excel)
Returns a Workbook object that represents the workbook in the active window (the window on top). Read-only. Returns Nothing if there are no windows open or if either the Info window or the Clipboard window is the active window.
expression A variable that represents an [Application](Excel.Application(Graph property).md) object.
This example displays the name of the active workbook.
MsgBox "The name of the active workbook is " & ActiveWorkbook.Name