Path and FullName

 

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.xlsm 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.xlsm.

MsgBox Workbooks(“path-fullname.xlsm”).Path

Result:

Excel VBA Path Property Result

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

MsgBox ActiveWorkbook.FullName

Result:

Excel VBA FullName Property Result

For a practical example of the FullName property, see our example program Create a Footer Before Printing.