Some Office users have recently experienced “Unknown error trying to lock file” while using Office apps like Excel, Teams, OneDrive, PowerPoint, etc. It’s even more frustrating for SharePoint business users, who rely on the service to share and edit files. In this post, we will try to fix the Unknown error trying to lock files in Teams, Excel, OneDrive, and SharePoint. This unknown error prevents users from accessing the file or even performing any task on it.
Teams, Excel, OneDrive, and SharePoint are essential tools for many individual and business users. The recent update by Microsoft seems to have temporary issues that trigger an unknown error trying to lock files. In some instances, the files open well on different browsers and in file desktop apps like Excel but fail in other Microsoft apps. Let us first look at the possible causes of this unknown error that is blocking your files.
Why do I get Unknown error trying to lock file in Office?
There are several reasons why you get an unknown error trying to lock files on Teams, Excel, OneDrive, etc. One of the most common causes of this error is temporary bugs and glitches in the Microsoft apps, especially after an update. Permission and Windows security settings or issues can trigger an unknown error trying to lock your file. The file might also be in use by another user; this can happen in cases where the system has stored processed and raw data in a certain directory structure. Network issues can also trigger errors when the connection is congested or not stable.
Fix Unknown error trying to lock file in Teams, Excel, OneDrive, PowerPoint
The unknown error may happen to one user or all users or clients in the same network in an organization. To fix the Unknown error trying to lock file in Teams, Excel, OneDrive, PowerPoint, SharePoint, etc, Office apps use the following solutions;
- Perform basic steps
- Clear Microsoft Office cache
- Revert to the previous app version
- Tweak Protected View settings
- Reset Office Upload Center
Let us have a look at these solutions in detail.
1] Perform basic steps
Sometimes, the Unknown error trying to lock file can be caused by simple glitches that can be resolved by performing basic steps. To fix the unknown error, perform the following preliminary steps:
- Scan your PC for viruses and malware. If your system or files are infected or attacked by malware, they might be locked by Windows security and they won’t open.
- Reboot your computer and check if the issue is resolved. You can also try to access such files in the Windows Safe Mode State.
- Exit apps that are running in the background. Some background apps can interfere with some files or other apps, triggering issues like unknown error trying to lock file in Teams, Excel, OneDrive, etc.
- Try to relaunch the affected app. For example, if you are getting the problem in Teams, restart the app and see if the error is resolved.
- Update your Microsoft Office if there are newer versions. The new versions come with fixed bugs and other necessary features.
2] Clear Microsoft Office cache
The unknown error that is trying to lock your files can be caused by a corrupted Office cache that is still stored in your system. Clearing the Office cache safely can greatly help you fix unknown errors. Here is how:
- Open the Run dialog box by pressing Windows key + R.
- Copy and paste the following path in the Run dialog box and press Enter on your PC keyboard:
%LOCALAPPDATA%\Microsoft\Office\
- Once the File Explorer is open, go to 16.0 > OfficeFileCache.
- Delete all files that have a prefix of FSF or FSD.
- Once you are done, restart your computer and start your app again.
3] Revert to the previous app version
If you continue to get the Unknown error trying to lock file on Teams, OneDrive, Excel, etc. after upgrading the app, you may try to resolve the problem by reverting to the previous version. You need to disable automatic Office updates and then revert to the previous version. To revert to the previous version in Teams, Excel, OneDrive, etc, follow the steps below;
- Launch the Office like Excel and go to File > Account > Update options > Disable updates.
- Next, open the Command Prompt by typing cmd on the Windows search box and select Run as administrator.
- To revert to the previous Office application copy and paste the following command line and press Enter (each at a time):
cd %programfiles%\Common Files\Microsoft Shared\ClickToRun
officec2rclient.exe /update user updatetoversion=(Previous version ID)
Replace ‘Previous version ID‘ with the actual value, like 16.0.16026.20200.
NOTE: The above steps can only be applied to Click-to-Run Microsoft Office versions.
Read: The function attempted to use a name that is reserved, Error 0x80071A90
4] Tweak Protected View settings
You might be getting the unknown error trying to lock file in Teams, Excel, OneDrive, etc because Windows thinks the file or document is potentially unsafe to open or edit. In this case, you need to change the Protected View settings as follows;
- Open the document default app like Excel, Word, Powerpoint, etc by searching their name in the search box and pressing Enter.
- Go to File > Options > Trust Center > Trust Center Settings > Protect View.
- Next, uncheck the box next to Enable Protected View for files located in potentially unsafe locations.
5] Reset Office Upload Center
Resetting the Microsoft Office Upload Center ensures that you delete all the cache from uploaded Office files. These caches can sometimes trigger an error that tries to lock the files. To reset the Office Upload Center, follow the steps below:
- Search Office Upload in the search box and select Open to launch the Office Upload Center.
- In the Upload Center, locate Settings and click on it.
- Locate the Cache settings and select Delete Cached files. All the cached files will be deleted.
- Next, check the box next to Delete files from the Office Document Cache when they are closed, and then select OK to complete the process.
Some users have reported that they get an Unknown error trying to lock files when they try to access files in SharePoint online Web. Let us look at this briefly.
How to fix SharePoint Unknown error trying to lock file
SharePoint is a great web application for collaboration and sharing files. If you are getting an unknown error trying to lock files while using SharePoint, try the following steps:
- Check out the file by selecting the document with the issue and clicking on the three horizontal dots, then click Check Out.
- Use the Registry Editor to create a network location. Type regedit on the Run dialog box and press Enter. Follow this path:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters.
- Next, right-click on an empty left-side space and click New. Rename the new value as AuthForwardServerList and hit Enter. Now, right-click on the newly created value (AuthForwardServerList ) and choose Modify. Enter the Website URL in the Value data option and select OK. Close the editor and relaunch your Webclient Service.
- Clear the browser cache. The process of clearing the browser depends on the type of browser you are using.
- Finally, you can exempt SharePoint from the Firewall security settings. Type firewall in the Windows search box to open Windows Defender Firewall. Click on Allow an app or feature through the Windows Defender Firewall option and choose Sharepoint. Check the box next to Public and Private. Hit OK to save and complete the process and restart your computer.
This should work for SharePoint users.
We hope one solution helps you to fix Unknown error trying to lock file on Teams, OneDrive, Excel, SharePoint, etc.
Fix: Excel ran out of resources while attempting to calculate one or more formulas
How do I unlock a locked Excel file for editing?
If an Excel file is locked for editing, you can unlock it by getting access from the other user, ensuring the version you are using supports co-authoring, or putting the document in SharePoint or OneDrive. Also, ensure the Excel document you are using is in the right format, ie .xlsx, .xlsm, or .xlsb.
Why does Excel say the file is locked by me?
The Excel file may say it’s locked if the user who shared it with you is currently editing the document. It can also be because the Office app running in the background has already opened the file. Another reason would be that the Excel file is already marked ‘Final’ and you are not allowed to update it. If the file is password-protected you must get the password to open it; there are no shortcuts to it.
Read next: We’re having trouble connecting to the server Excel error.