How to Handle OneDrive Files Locked by Teams Preview
🔍 WiseChecker

How to Handle OneDrive Files Locked by Teams Preview

When you try to edit a OneDrive file that is currently being previewed by someone in Microsoft Teams, you may see a lock icon or an error message stating the file is in use. This happens because Teams opens a read-only preview of the file, which triggers OneDrive to mark it as locked by another application. The file remains locked until the Teams preview session ends or the user closes the preview. This article explains why Teams preview locks OneDrive files, provides step-by-step methods to unlock them, and covers related issues you may encounter.

Key Takeaways: Unlocking OneDrive Files Locked by Teams Preview

  • Close the Teams preview window: The simplest fix — ask the Teams user to close the preview tab or navigate away from the file.
  • Force close the file from OneDrive web: Use the OneDrive web app to see who has the file open and request them to release it.
  • Use the Manage Access feature: In OneDrive, go to file details > Manage Access to view and remove lock holders.

ADVERTISEMENT

Why Teams Preview Locks OneDrive Files

When a user opens a file in Teams preview, Teams requests a read-only lock from OneDrive to prevent simultaneous edits that could cause version conflicts. This is a safety feature built into Microsoft 365 to protect data integrity. However, the lock persists even if the user only glances at the file and then leaves it open in the background. The lock is tied to the Teams session, not the user’s account, so closing the Teams app or signing out may not release it immediately. The lock expires automatically after a period of inactivity, but this can take up to 15 minutes.

How the Lock Works

OneDrive uses a file-locking mechanism that prevents write access when a file is opened by another application. For Office files like Word, Excel, and PowerPoint, the lock is applied at the file level and is visible in File Explorer with a small lock icon overlay. For non-Office files, the lock may not be visible but still prevents editing. Teams preview uses the same locking mechanism as the Office desktop apps, which is why the lock appears even though the user is only viewing the file.

Steps to Unlock OneDrive Files Locked by Teams Preview

Method 1: Ask the Teams User to Close the Preview

The quickest way to release the lock is for the person who previewed the file to close the preview tab in Teams. Follow these steps:

  1. Identify who has the file open
    In OneDrive web, open the file location and look for the lock icon next to the file name. Hover over the icon to see who has the file locked.
  2. Contact the user
    Use Teams chat or email to ask the user to close the preview tab. The user should click the X on the preview tab or navigate to a different channel or chat.
  3. Wait for the lock to release
    After the user closes the preview, the lock should release within 30 seconds. Refresh the OneDrive page or File Explorer to verify.

Method 2: Force Close the File from OneDrive Web

If you cannot reach the user or the lock persists, you can force close the file from the OneDrive web interface. This requires edit permissions on the file.

  1. Open OneDrive in a browser
    Go to onedrive.live.com and sign in with your work or school account.
  2. Navigate to the locked file
    Browse to the folder containing the locked file. Do not click the file to open it.
  3. Select the file and click Info
    Click the circle next to the file name to select it. Then click the Info button in the top toolbar. It looks like a lowercase i in a circle.
  4. Click Manage Access
    In the details pane on the right, scroll down to the Manage Access section. Click Manage Access.
  5. Remove the lock holder
    You will see a list of people who have the file open. Find the user who has it locked from Teams preview. Click the three dots next to their name and select Remove. Confirm the action.

Method 3: Use the OneDrive Sync Client to Override

If the file is synced locally via the OneDrive sync client, you can sometimes bypass the lock by working offline.

  1. Pause syncing
    Right-click the OneDrive cloud icon in the system tray and select Pause syncing. Choose 2 hours.
  2. Edit the local copy
    Open the file from the local OneDrive folder. You can edit it because the sync client is paused and the lock is not enforced locally.
  3. Resume syncing
    After editing, right-click the OneDrive icon again and select Resume syncing. The file will upload and overwrite the locked version. Note that this may cause a conflict if the Teams user saves changes.

ADVERTISEMENT

If OneDrive Files Still Show as Locked After Teams Preview

The Lock Does Not Release After the Teams User Closes the Preview

Sometimes the lock persists due to a delay in Teams releasing the file handle. Wait up to 15 minutes for the lock to expire automatically. If it still does not release, the Teams user should sign out of Teams completely and sign back in. This forces Teams to close all open file handles. Alternatively, the user can restart the Teams app.

Multiple Users Have the Same File Locked

If more than one user previewed the file, each preview may create a separate lock. Use the Manage Access method described above to remove each lock holder individually. If you cannot remove them, ask all users to close their Teams preview tabs.

You Cannot Access Manage Access Because You Do Not Have Edit Permissions

If you only have view or comment permissions on the file, you cannot remove lock holders. Contact the file owner or a site administrator. They can use the same Manage Access method to release the lock. If the file is in a shared library, the library owner can also break the lock from the SharePoint admin center.

Teams Preview vs Desktop App Locking: Key Differences

Item Teams Preview Desktop App
Lock type Read-only lock that prevents editing Read-write lock that prevents other users from editing
Lock visibility Lock icon in OneDrive web and File Explorer Lock icon plus a message in the desktop app
Lock duration Until preview tab is closed or up to 15 minutes Until the desktop app closes the file
Release method Close preview tab, Manage Access, or wait Close the file in the desktop app

Understanding the difference helps you choose the right fix. Teams preview locks are temporary and less intrusive than desktop app locks. In most cases, asking the user to close the preview tab resolves the issue within seconds. For stubborn locks, the Manage Access method in OneDrive web gives you direct control to remove the lock holder.

If you frequently encounter locked files from Teams preview, consider advising your team to use the Open in Browser option instead of preview for files they need to view quickly. This opens the file in the Office web app without locking it for other editors. You can also set a Teams policy that restricts preview to specific file types to reduce accidental locks.

ADVERTISEMENT