How to open the folder containing the current workbook in Excel?
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")
2. Now, you can click the hyperlink to go the file path of the current workbook.
- 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.
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 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.
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
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.





- 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