Fix Office Files Not Opening in Desktop Apps from OneDrive or SharePoint
Question details
The user is unable to open Microsoft 365 files in local desktop applications when launching them from OneDrive or SharePoint via Microsoft Edge.

- Product
- Microsoft 365
- Device & OS
- Windows 10 or 11
- Scenario
- Attempting to switch a file session from the OneDrive or SharePoint web interface in Microsoft Edge to the local Office desktop application.
- Observed behavior
- The files open correctly from the local File Explorer, but fail to open when initiated from OneDrive or SharePoint on the web, likely due to corrupted local credentials.
Ensure you have administrative privileges on your Windows PC and save any open work before proceeding, as you will need to close all Office applications and run administrative scripts.
Reset Office Activation State and Clear File Cache
This is the most effective solution. It removes corrupted local credentials and temporary files that Office uses to authenticate documents hosted on SharePoint or OneDrive.
When opening a file from SharePoint or OneDrive in the desktop client, Office checks your local credentials. If these credentials become corrupted, the desktop app will fail to load the file.
Using Microsoft's official script to clean up the license state, combined with clearing the local Office cache, will force the application to prompt for a fresh, clean login.
Open any Office application like Word or Excel, sign out of your Microsoft 365 account from the top right corner, and then completely close all running Office applications.
Download Microsoft's OLicenseCleanup.vbs tool from the official Microsoft troubleshooting page. Right-click the downloaded file and select 'Run as administrator' to reset your Microsoft 365 Apps activation state.
Open File Explorer and navigate to C:\Users\%userprofile%\AppData\Local\Microsoft\Office\16.0\OfficeFileCache and C:\Users\%userprofile%\AppData\Local\Microsoft\Office\SPW. Delete all files and folders contained within these two directories.
Reopen Microsoft Word or Excel, sign back in with your Microsoft 365 credentials, and try opening a file from OneDrive or SharePoint via Microsoft Edge again.

Perform an Online Repair for Microsoft Office
If resetting the credentials does not work, repairing the Office installation can fix corrupted system files that handle the handoff between the web browser and the desktop app.
Use WPS Office to Open and Edit Your Cloud Files Seamlessly
If Microsoft 365 desktop apps continue to experience credential or cache issues, consider switching to WPS Office. It provides a lightweight, highly compatible, and free alternative to Microsoft Office, allowing you to easily access, edit, and save your documents without complex activation or credential errors.
- 1. Download and Install: Download WPS Office for free from the official website and install it on your Windows PC.
- 2. Open Your Documents: Launch WPS Office, click on 'Open', and select your downloaded OneDrive or SharePoint files to start editing immediately.

Frequently Asked Questions
Will deleting the OfficeFileCache folder remove my actual documents?
No, the OfficeFileCache folder only stores temporary cached versions of your files to speed up opening times and synchronize changes. Deleting its contents will not delete your original files stored safely on OneDrive or SharePoint.
What does the OLicenseCleanup.vbs script do?
It is an official Microsoft troubleshooting script designed to remove old, corrupted, or conflicting Office activation credentials and licenses from your device. Running it forces Office to prompt for a fresh sign-in, resolving many cloud authentication issues.
Why do my OneDrive files open in the browser instead of the desktop app?
This usually happens if your browser or OneDrive settings default to Office Online. You can change this behavior by right-clicking the file in SharePoint or OneDrive web settings and manually selecting 'Open in desktop app'.
Do I need to run a repair for Microsoft Edge as well?
While usually unnecessary for this specific issue, if Microsoft Edge is failing to pass the launch command to your desktop apps entirely, running a repair on Edge through the Windows 'Apps & features' settings menu can help ensure the browser integration works correctly.




