KutoolsforOffice — One Suite. Five Tools. Get More Done.

How to get the active workbook location/path in Excel?

AuthorSunLast modified

When working with multiple Excel workbooks simultaneously, especially during data analysis, reporting, or collaborative tasks, it's common to lose track of where each file is actually saved on your computer. This can make it challenging to manage files, share accurate file locations with colleagues, or simply keep your documents organized. Excel itself does not display the full file path prominently, so users often need quick and reliable ways to retrieve this information. Below are several practical methods to easily obtain the active workbook’s location or path, helping you stay organized and efficiently manage your files.

Get workbook location with formulas

Get workbook location with Kutools for Excel good idea3

Get workbook location with VBA

Open the containing folder with Kutools for Excelgood idea3


Get workbook location with formulas

Excel offers formulas that allow you to display a workbook’s file path and related details directly within a worksheet. This is a straightforward solution that requires no special tools or programming, making it suitable if you need to display the workbook path for documentation, auditing, or reference purposes.

To use this method, simply select an empty cell in your worksheet where you'd like the location to appear. Paste one of the following formulas in that cell and press Enter:

To get the workbook location (folder path only):

=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1))-1)

This formula will extract just the file path where your workbook is saved. It’s useful for quickly seeing the folder location without additional details.

To get the workbook location and workbook name:

=SUBSTITUTE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1),"[","")

This version includes both the folder path and the file name, making it ideal if you want a complete file reference in your worksheet.

To get the workbook location, workbook name, and the active worksheet name:

=CELL("filename",A1)

This formula outputs the full file path, the workbook name, and the worksheet name separated by square brackets and exclamation points. This is particularly useful when auditing file versions or sheet content.

After entering your chosen formula, press Enter. The result will instantly display in the cell. You can drag the fill handle to copy the formula to other sheets if required.

Parameter overview: All formulas above use the CELL function. The "filename" parameter returns the complete path and file name, and referencing A1 ensures the function targets the current sheet. If your workbook contains multiple sheets, the sheet name will reflect the one in which the formula is entered.

Important notes and troubleshooting:

  • If you have never saved the current workbook, the formulas that attempt to extract file path and name (the first two formulas) will display a #VALUE! error.
  • The formula =CELL("filename",A1) will simply return a blank if your workbook hasn't been saved yet.
  • If you later move your file to a different folder, you must re-save it and recalculate formulas if you want the updated path to show.
  • These formulas display the path for the current sheet only. If sheets are renamed, update the formula references accordingly.

As a tip, if you regularly need to show or use workbook locations in your documentation, consider placing these formulas in a standard location (such as the first worksheet) for every workbook you create.


Get workbook location with Kutools for Excel

If you’re looking for a more user-friendly option, especially in complex workbooks or when you frequently need to insert file details, Kutools for Excel provides a dedicated feature called Insert Workbook Information. This tool not only allows you to capture the workbook’s path but also provides flexibility to insert its details directly into a specified cell, header, or footer for enhanced documentation or printing needs. It’s ideal for users who want to streamline their workflow and avoid formula errors due to unsaved files.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

After freely installing Kutools< for Excel, please follow these steps:

1. Select the cell where you want to insert the workbook location. Then click Kutools Plus > Workbook > Insert Workbook Information. You’ll see the following interface:

2. In the Insert Workbook Information dialog, pick the specific information you need from the Information section. Options include: folder path, file name, sheet name, and more. Additionally, choose where the information should be inserted: in the cell, as a header, or as a footer in the Insert at area.

set options in the Insert Workbook Information dialog

3. Click OK to confirm. Your selected workbook information will appear in the chosen location automatically.

the information you selected has been inserted

Note: If the active workbook has never been saved, Kutools will insert the message “This workbook never saved” to alert you. This avoids confusion and incorrect documentation.

You can use this feature not only for tracking file locations but also for printing header/footer documentation, helping ensure file management standards in collaborative settings. If you frequently archive or share files, adding workbook location information makes retrieval and reference faster for everyone involved.

This utility is particularly suited for professionals managing large numbers of workbooks, as well as those needing to document workbook paths for compliance or team workflows. It is simple to apply and reduces manual entry errors.


Get workbook location with VBA

Advanced users and those comfortable with a bit of automation can extract the workbook location using VBA (Visual Basic for Applications). This approach is flexible and can be customized to display the path, file name, and other details in a dialog box or within the spreadsheet. It’s especially useful if you wish to automate file management tasks or integrate path information with other macros.

To get started, make sure you have enabled the Excel file of interest, then follow these steps:

1. Open the workbook for which you want to retrieve the location. Press Alt + F11 to access the Microsoft Visual Basic for Applications window. Click Insert > Module to create a new Module.

2. Copy and paste one of the VBA codes below into the newly created Module window.

VBA: Show workbook location

Sub DisplayWorkbookPath()
    MsgBox ActiveWorkbook.Path, vbInformation, "Workbook Path"
End Sub

3. To run the code, click the Run button (or press F5). A dialog box will appear displaying the workbook path.

vba code to show the workbook path

Note: If the workbook has not been saved, the dialog box will be blank, indicating there is currently no file path available.

 a blank dialog box is shown if the file is not saved

For a more detailed output (including the workbook name), you may use the following VBA code:

VBA: Show workbook location and workbook name

Sub DisplayWorkbookFullName()

    MsgBox ActiveWorkbook.FullName, vbInformation, "Workbook Complete Path"

End Sub

If you want to write the location to a cell or integrate with other macros, update the code accordingly or reference additional VBA properties like ThisWorkbook.FullName and ThisWorkbook.Name.

This method is suitable for users who want to automate file management or generate file location reports programmatically. However, VBA code execution is only possible if macros are enabled in your workbook, so verify your security settings before use.


Open the containing folder with Kutools for Excel

If you need to access the folder containing your current workbook directly—for example, to organize files, share via email, or open related documents—you can use the Open Containing Folder feature in Kutools for Excel. This is a convenient shortcut, saving time compared to manually navigating through your system directories.

After freely installing Kutools for Excel, perform the following steps:

Make sure your target workbook is active. Then go to Kutools Plus > Workbook > Open Containing Folder and click the option as shown below:

The Windows File Explorer will immediately open to the folder location of your workbook, allowing you to view, manage, or share your file more efficiently.

This technique is especially handy for users who frequently switch between several files stored in different directories, or who need to quickly access attachments and resources related to their workbooks.

Note: If your workbook has not been saved, this feature will prompt you to save your file first before the folder can be opened. Always ensure your document is saved to avoid disruptions.

If the above methods do not meet your needs or if you are looking for alternatives, two additional solutions worth considering include:

  • Quick Access via Excel Title Bar: For recent Excel versions, you can right-click on the workbook's name in the title bar to reveal its folder location. This is a direct method, but works only with saved files and selected Excel versions.
  • File Properties in Windows Explorer: Locate your workbook in Windows File Explorer, right-click the file, and select Properties. You’ll find the full location in the “Location” field. This method provides the file path, though it requires manual navigation.

For best practice, always save your workbook before attempting to retrieve its path using any of these methods. If you run into errors or blank results, first check whether your file has been saved. When working with VBA, ensure macros are enabled, and if using Kutools, double-check the installation and activation.

Best Office Productivity Tools

🤖Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |  Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |  Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

ExcelWordOutlookTabsPowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in