Excel Office

Excel How Tos, Tutorials, Tips & Tricks, Shortcuts

Path and FullName property in Excel VBA

The Path property in Excel VBA returns the complete, saved path to the workbook (Excel file). The FullName property in Excel VBA returns the complete, saved path, including the name of the workbook.

Download path-fullname.xls and add it to “C:\test\”

Place a command button on your worksheet and add the following code lines:

1. The following code line returns the complete path to path-fullname.xls.

MsgBox Workbooks("path-fullname.xls").Path

Result:

2. The following code line returns the complete path, including the name of the active workbook.

MsgBox ActiveWorkbook.FullName

Result:

Leave a Reply

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