Display an Excel Workbook’s File Location in Excel for the Web
Question details
The user needs to display an Excel workbook’s file location while using Excel for the web.

- Product
- Excel for the web and Office Scripts
- Device & OS
- not provided
- Scenario
- The workbook is stored online, and the user wants its location available inside the workbook.
- Observed behavior
- CELL("filename",A1) does not provide the same path information in Excel for the web as in desktop Excel, and workbook.getName() returns only the workbook name and extension.
Locate the workbook in OneDrive or SharePoint and confirm that you can open it. If you plan to use a desktop formula, make sure the workbook has been saved.
Copy the OneDrive or SharePoint link into the workbook
Use this method to make a workbook link available in Excel for the web.
Open OneDrive or the SharePoint document library and locate the workbook.
Select the workbook, choose Share or Copy link, review the link access settings, and copy the link.
Open the workbook in Excel for the web, select a cell, and paste the copied link. Optionally, label an adjacent cell so others know what the link is for.

Display the saved workbook location in desktop Excel
Use desktop Excel when you need CELL to return the saved workbook’s location and sheet name.
Work with Excel Workbooks in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface. Open compatible Excel files and move between office tools easily, though WPS does not change Excel for the web’s path limitations.

Frequently Asked Questions
Why doesn’t CELL("filename",A1) show the path in Excel for the web?
Excel for the web does not provide the same workbook path information through CELL as desktop Excel. Use a copied OneDrive or SharePoint link in a cell, or open the saved workbook in desktop Excel.
Can an Office Script get the workbook’s full URL with getName()?
No. workbook.getName() returns the workbook name and extension, not its full document URL. Copy the link from OneDrive or SharePoint if you need to store it in the workbook.
Does a copied sharing link show the exact file path?
Not necessarily. A link copied through Share or Copy link may be a sharing URL rather than the exact document URL or a local path. Check its access settings before sharing it.
Why is CELL("filename",A1) empty in desktop Excel?
The workbook must be saved before the formula can return its location. Choose File > Save or Save As, then check the formula again.




