Fix Excel Invalid Token Error When Using OneDrive Link in Get Data From Web
Question details
The user needs to resolve the invalid token error that appears when using a copied OneDrive file link in Excel's Get Data From Web feature.

- Product
- Microsoft Excel and OneDrive
- Device & OS
- not provided
- Scenario
- Importing data from a OneDrive-hosted file into Excel using the Data > Get Data > From Web feature.
- Observed behavior
- Excel returns an invalid token error because the copied OneDrive link is not a supported web query authentication link.
Confirm the file is shared with the correct permissions in OneDrive on the web, and avoid reusing a link copied from an Office document because it may contain a session-specific token.
Get Current OneDrive Link and Authentication Guidance from OneDrive Support
Use this solution when Excel returns an invalid token error, because OneDrive sharing links and authentication methods change and Microsoft provides the current supported options.
Open a browser, go to onedrive.com, and sign in with the Microsoft account that has access to the file.
Click the Help icon in the upper-right corner of OneDrive on the web.
Select Email OneDrive Support and follow the prompts to describe the invalid token error in Excel Get Data From Web.
Search the OneDrive Help Center for supported sharing links and authentication methods if you prefer self-service guidance.

Generate a New OneDrive Share Link Before Connecting in Excel
Try this first if you want to test whether the old link or the file permission is causing the invalid token error.
Switch to WPS Office for Familiar Spreadsheet Editing and Web Data Import
WPS Office is a free, lightweight Office alternative that opens and edits Excel workbooks with familiar tools, supports Microsoft Excel file formats, and gives you a straightforward spreadsheet environment for data import tasks.

Frequently Asked Questions
Why does Excel Get Data From Web show an invalid token error with my OneDrive link?
Excel returns this error when a OneDrive link copied from an Office document contains a session-specific authentication token or uses a sharing method that Get Data From Web does not support. Use a fresh OneDrive share link from onedrive.com with the correct permission instead.
How do I create a supported OneDrive link for Excel Get Data From Web?
Sign in to onedrive.com, select the file, click Share, choose a permission such as Anyone with the link or People in your organization, copy the link, and paste it into Excel's Data > Get Data > From Web dialog.
Where can I get current OneDrive connection support?
Sign in to OneDrive on the web, select the Help icon, choose Email OneDrive Support, and follow the prompts. You can also search the OneDrive Help Center for supported sharing links and authentication methods.
Can WPS Office open Excel files that use Get Data From Web?
WPS Office opens .xlsx and .xls workbooks and includes spreadsheet data tools, but external web query connections may need to be refreshed or re-created after opening the file in WPS Spreadsheets.




