File Cannot Open

Fix Office Files Not Opening in Desktop Apps from OneDrive or SharePoint

Tauseeq MagsiTauseeq Magsi Nov 2, 2026 869 views

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.

Fix Office Files Not Opening in Desktop Apps from OneDrive or SharePoint
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.
Before you start

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.

Solution 1Recommended

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.

1
Sign out and close Office apps

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.

2
Run the OLicenseCleanup script

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.

3
Delete Office cache files

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.

4
Sign in and test

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.

Reset Office Activation State and Clear File Cache
Locating the AppData Folder: The AppData folder is hidden by default in Windows. You can access it by typing %appdata% in the Windows search bar, or by enabling 'Hidden items' in the File Explorer View tab.
Free Microsoft Office alternative

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. 1. Download and Install: Download WPS Office for free from the official website and install it on your Windows PC.
  2. 2. Open Your Documents: Launch WPS Office, click on 'Open', and select your downloaded OneDrive or SharePoint files to start editing immediately.
Fully compatible with Microsoft Office formats including DOCX, XLSX, and PPTX.Lightweight installation with zero complex activation scripts needed.Familiar user interface for a seamless transition from Microsoft 365.Built-in file management that makes accessing local and downloaded cloud files easy.
microsoft office alternative - wps office

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.