To check excel workbook path or location via vba, the code
below will get the path or location of the workbook.
Application.ActiveWorkbook.Path === Path only without the workbook name
Application.ActiveWorkbook.FullName === Display path and the
workbook name
Sample code:
Sub Display_WB_Location()
Dim xPath_Workbook
xPath_Workbook = Application.ActiveWorkbook.FullName
'xPath_Workbook = Application.ActiveWorkbook.Path
Msgbox xPath_Workbook
End Sub
If the file is open, just click on "File" then click
"Info" to show workbook location.
See image below:
Sometimes it's useful to know the location, especially if you're working on a lot of folders and files. And forget which folder or the file location.
Cheers!!! Hope it helps!!!
Comments
Post a Comment