Copy Full Path of One Workbook? Quick Answer
In this article
- Why You Might Need the Full Path
- Method 1: Using File Explorer (Windows)
- Method 2: From Excel’s Save As Dialog
- Method 3: Using the Excel Interface (Quick Access Toolbar)
- What If the Workbook Is Unsaved or in OneDrive?
- Common Problems and Solutions
- Alternatives: Using Command Line or PowerShell
- Frequently Asked Questions
To copy the full path of a single Excel workbook, you don’t need any add-ins or VBA. The quickest way is to hold Shift while right-clicking the file in Windows Explorer (or File Explorer) and choose Copy as path from the context menu. This puts the complete file location, such as C:\Users\YourName\Documents\Sales.xlsx, onto your clipboard, ready to paste anywhere.
Why You Might Need the Full Path
Knowing the exact full path is useful in several everyday situations:
- Sharing a file location with a colleague via email or chat, so they can navigate directly to it.
- Creating a hyperlink in another document that opens the workbook directly.
- Writing a script, macro, or formula that references the file’s location.
- Troubleshooting issues when Excel can’t find a linked file, because the path tells you exactly where Excel is looking.
- Backing up or moving files while preserving folder structure.
Without the full path, you might only see the file name, which is ambiguous if you have multiple files with the same name in different folders.
Method 1: Using File Explorer (Windows)
This is the most direct method and works in all recent versions of Windows (Windows 10 and 11).
- Open File Explorer (Windows key + E).
- Navigate to the folder that contains your workbook.
- Hold down the Shift key on your keyboard.
- While holding Shift, right-click on the workbook file.
- In the context menu that appears, select Copy as path. (Note: This option only appears when Shift is held.)
- The full path is now copied to your clipboard. Paste it with Ctrl+V wherever you need it.
The copied path will be enclosed in quotation marks, like "C:\Users\Name\Documents\Sales.xlsx". This is normal—just remove the quotes if you don’t want them.
Method 2: From Excel’s Save As Dialog
If you already have the workbook open in Excel, you can also get the path from the Save As dialog:
- Click File > Save As (or press F12).
- In the Save As dialog, click once on the address bar at the top (where the current folder path is shown).
- Press Ctrl+A to select the entire path, then Ctrl+C to copy it.
- Click Cancel to close the dialog without saving (unless you actually want to save).
This copies the folder path, not the file name. You’ll need to manually add the file name and extension at the end, like \Sales.xlsx.
Method 3: Using the Excel Interface (Quick Access Toolbar)
For a more permanent solution, you can add a button to Excel’s Quick Access Toolbar that copies the full path of the currently open workbook.
- Click the small down arrow at the end of the Quick Access Toolbar (top-left corner).
- Choose More Commands….
- In the “Choose commands from” dropdown, select All Commands.
- Scroll down and select Copy Document Path (or “Copy Path” depending on your Excel version).
- Click Add > OK.
Now, when you click that button, Excel copies the full path of the active workbook to your clipboard. This method works even if the file is stored on SharePoint or OneDrive (though the path may be the web URL instead of a local file path).
What If the Workbook Is Unsaved or in OneDrive?
If the workbook has never been saved, there is no full path to copy—only the default “Book1” name. You must save it first (Ctrl+S) to a location.
For workbooks stored in OneDrive or SharePoint, the “Copy as path” method in File Explorer copies the local synced path (e.g., C:\Users\You\OneDrive\Documents\file.xlsx). However, if you want the web URL (to share with others), you can right-click the file in OneDrive’s web interface and choose “Copy link.” In Excel, the “Copy Document Path” button may also give you the web URL if the file is opened from the cloud.
Common Problems and Solutions
Sometimes the “Copy as path” option doesn’t appear, or the path is not what you expect. Here are common issues:
- Shift not held: Make sure you hold Shift before right-clicking. If you release it too early, the option disappears.
- Path is in quotes: That’s normal. If you need it without quotes, just delete them after pasting.
- Path is too long: Windows has a maximum path length of 260 characters by default. If your path exceeds that, you may need to enable long paths in the registry or move the file to a shorter path.
- File is on a network drive: The path may be shown as a mapped drive letter (e.g.,
Z:\folder\file.xlsx) instead of the UNC path (e.g.,\\server\share\folder\file.xlsx). To get the UNC path, you can use the command prompt or PowerShell. - You need the path in Excel formulas: You can use the
CELL("filename")function in Excel to return the full path of the current workbook. For example,=CELL("filename")returns something likeC:\Users\Name\Documents\Sales.xlsx.
Alternatives: Using Command Line or PowerShell
If you prefer keyboard-only methods, you can use a command-line tool:
- Open Command Prompt or PowerShell.
- Type
cdfollowed by the folder path (or just navigate there). - Type
echo %cd%\filename.xlsx(in CMD) orpwd(in PowerShell) to see the full path. - Copy the output manually.
This is more cumbersome but works without a mouse.
Frequently Asked Questions
Does “Copy as path” work on Mac?
No, this is a Windows-specific feature. On a Mac, you can right-click the file in Finder and hold the Option key to see “Copy as Pathname.” Alternatively, you can drag the file into a Terminal window to get its full path.
Can I copy the path of a workbook that is open in Excel without saving it?
No, if the workbook hasn’t been saved yet, there is no path to copy. You must save it first.
How do I copy the path of a workbook from within Excel using a formula?
Use the CELL function: =CELL("filename"). This returns the full path, file name, and sheet name (e.g., C:\Users\Name\Documents\Sales.xlsx\Sheet1). To get just the folder path, you can combine it with LEFT and FIND functions.
Why does the copied path have quotation marks around it?
Windows adds quotes automatically to handle spaces in file names. If you don’t need them, just remove them after pasting.
Can I copy the path of a workbook that is on SharePoint?
Yes, but the path may be a web URL (https://) rather than a local file path. In Excel, the “Copy Document Path” button may give you the web URL. In OneDrive, right-click the file and choose “Copy link.”
What if I need the path for a macro or VBA code?
In VBA, you can use ThisWorkbook.FullName to get the full path of the workbook containing the code. For the active workbook, use ActiveWorkbook.FullName.