How To Get Path And Fullname In Excel

Oct 18, 2020 • edited Oct 21, 2020

How To Get Path And Fullname In Excel

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.

#Tutorial#How To#VBA#Workbook#Worksheet

How To Create Progress Indicator In Excel

How To Import Data From A Text File In Excel