Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

How to open the folder containing the current workbook in Excel?

Author Kelly Last modified

When working with Excel, there are many scenarios where quickly accessing the folder containing your workbook can boost productivity. Whether you’re troubleshooting, organizing files, or simply managing related documents, having an easy way to open the folder from within Excel is incredibly useful. In this article, we explore several methods to achieve this.

Open the folder containing the current workbook


Open the folder containing the current workbook by a formula

Using a formula to open the containing folder of the current workbook in Excel is a practical, efficient solution that eliminates the need for macros. By leveraging the CELL function along with string manipulation functions such as LEFT, FIND, and SUBSTITUTE, you can create a dynamic hyperlink that simplifies file navigation.

1. Simply copy and paste the formula into any cell in your workbook, this formula creates a clickable link that directs to the file path of the current workbook.

=HYPERLINK("file:///" & SUBSTITUTE(LEFT(CELL("filename", A1), FIND("[", CELL("filename", A1)) - 1), "\", "/"), "Open Containing Folder")

Open the containing folder of the current workbook with a formula

2. Now, you can click the hyperlink to go the file path of the current workbook.

Open the containing folder of the current workbook with a formula

Note: This formula only works when the workbook is saved; if the workbook is not saved, an error will be displayed.
Explanation of this formula:
  • CELL("filename", A1):
    Retrieves the full file path, including the workbook and sheet name (for example: C:\Users\Username\Documents\[Workbook.xlsx]Sheet1).
  • FIND("[", CELL("filename", A1)):
    Locates the position of the [ character, which indicates where the workbook name begins.
  • LEFT(CELL("filename", A1), FIND("[", CELL("filename", A1)) - 1):
    Extracts the folder path by taking all characters before the [ character. For example, it extracts C:\Users\Username\Documents\.
  • SUBSTITUTE(..., "", "/"):
    Converts the backslashes (\) to forward slashes (/). This formatting is often required in hyperlink URLs.
  • "file:///" & ...:
    Concatenates "file:///" with the formatted folder path to create a valid URL that opens the folder in Windows Explorer.
  • "Open Containing Folder":
    This is the display text for the hyperlink.

Open the folder containing the current workbook with Kutools for Excel

Kutools for Excel's "Open Containing Folder" tool streamlines your workflow by automatically opening the folder that houses your current workbook with just one click. This intuitive feature not only saves you valuable time but also simplifies file management, allowing you to quickly access, organize, and manage all related documents.

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

Click "Kutools Plus" > "Workbook" > "Open Containing Folder" to open the current workbook's containing folder. Additionally, the current workbook will be highlighted in the document folder.

Open the containing folder of the current workbook with kutools for Excel

Note: If the workbook is not saved, this feature will remain disabled.

Open the folder containing the current workbook with VBA code

Excel does not have a built-in command to directly open the folder of the current workbook. However, VBA provides a flexible way to add this functionality. Here’s how you can create a macro that opens the folder:

1. Click "Alt+F11" to open the "Microsoft Visual Basic for Applications" window.

2. Click "Insert" > "Module", and paste the following VBA code into the Module window.

Sub OpenContainingFolder()
'Updateby Extendoffice
    Dim wbPath As String
    wbPath = ThisWorkbook.Path
    If wbPath <> "" Then
        Shell "explorer.exe " & wbPath, vbNormalFocus
    Else
        MsgBox "This workbook hasn't been saved yet. Please save it first.", vbExclamation
    End If
End Sub

3. Press the F5 key to run the code, and the current workbook's containing folder will open instantly.

Note: If the workbook is not saved, running the code will trigger a prompt reminding you to save it.

In summary, opening the containing folder of the current workbook in Microsoft Excel can be accomplished through various methods, each catering to different user preferences and workflows. By using formulas, you can dynamically display the file path within a cell, providing a quick reference to the folder location. For those who prefer a more user-friendly approach, Kutools for Excel offers a streamlined solution with its built-in features, making it an excellent choice for users who frequently manage files and folders. Additionally, VBA code provides a powerful and customizable option for advanced users, allowing automation and integration into larger workflows.

Choose the method that best aligns with your needs and consider integrating these techniques into your daily Excel tasks for a smoother and more organized experience. If you're interested in exploring more Excel tips and tricks, our website offers thousands of tutorials to help you master Excel.

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.

Excel Word Outlook Tabs PowerPoint
  • 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