“The File is Locked for Shared Use” Error in SharePoint Online

Recently, I was working with a client to setup their SharePoint Online portal home page. As a part of this, we wanted to display news in the home page. But we wanted to also implement audience targeting in the SharePoint news web part.

While trying to provide the audience group for each news in the Site Pages library, I received the error: “the file is locked for shared use by…”.

I will show you here how to fix the SharePoint Online error that says: the file is locked for shared use by user.

What Happened in My Case (And Probably Yours Too)

Here’s the scenario that led me to this error:

I created several news posts in SharePoint Online team site. Nothing fancy – just standard news articles for our SharePoint intranet site. Then I wanted to set up audience targeting so different groups would see different news items.

When I tried to edit the news page (Site Pages library) and add a Microsoft 365 group name in the audience targeting box, boom – error message: “The file is locked for shared use.”

the file is locked for shared use by sharepoint online

After some head-scratching, I realized the problem: I had created the news articles but never actually published them. They were sitting in draft mode.

Once I published those pages properly, the error disappeared completely.

Why This Error Happens

SharePoint treats news pages as special files. When a page is in draft mode, it’s in a weird in-between state. It exists, but it’s not fully available for all operations.

Think of it like this: when you’re editing a Word document and someone else tries to open it, they get a “locked” message. Draft news pages in SharePoint behave similarly – they’re locked for certain operations until you publish them.

The audience targeting feature needs to work with a fully published page. It can’t properly apply targeting rules to something that’s still in draft mode.

Most of the time, even you just edit the news page and close it without doing anything, that might also cause the issue.

Fix: the file is locked for shared use by SharePoint Online

Here is a quick solution to fix the error: the file is locked for shared use by user:

  1. Go to your SharePoint site
  2. Navigate to Site Pages library
  3. Find your news articles
  4. Check their status – are they “Draft” or “Published”?
  5. For any drafts, open them and click “Publish”
  6. Now try adding audience targeting again

That’s it. Seriously.

But let’s go through this step-by-step with more details so you understand exactly what’s happening.

The File is Locked for Shared Use by User: Step-by-Step Solution

Follow the step by step solution to fix the issue.

Step 1: Navigate to Your Site Pages Library

First, you need to get to where SharePoint stores all your pages. The news are stored in Site Pages library in SharePoint Online.

  • Go to your SharePoint site (the one where you created the news)
  • Click on the gear icon (Settings) in the top right
  • Select “Site contents”
  • Click on “Site Pages”

Alternatively, you can just add “/SitePages” to the end of your site URL. For example: https://yourcompany.sharepoint.com/sites/YourSite/SitePages

Step 2: Check the Status of Your News Articles

  • Once you’re in the Site Pages library, look at the list of pages. You can see a “Needs Publishing” icon and when you select the page it will display the Republish button in the command bar like in the screenshot below:
the file is locked for shared use by me

Step 3: Publish Those Pages

  • Click on the Republish button to publish the page.

Step 4: Verify the Publication

  • Once you click on the Republish button, it will display a successful message and also the “Need Publishing” icon will not appear. Even when you select the news and look at the command bar, you will not see the Republish button.

Here is a screenshot below for your reference.

the file is locked for shared use by sharepoint

Check out Create Site Retention Policies in SharePoint

Other Reasons You Might See This Error

While unpublished pages are the most common cause, here are other situations that can trigger the “locked for shared use” error:

Someone Else is Editing the Page

If another person has the page open in edit mode, SharePoint locks it. This prevents conflicts where two people are changing the same page at once.

Solution: Ask them to save and close, or wait until they’re done.

The Page is Checked Out

SharePoint has a “check out” feature for pages. If a page is checked out (even by you, from a different session), it might be locked.

Solution:

  • Go to Site Pages library
  • Find the page with a little green arrow icon (checked out indicator)
  • Click the three dots next to it
  • Select “Discard checkout” or “Check in”

Browser or Session Issues

Sometimes SharePoint thinks you’re still editing a page even though you closed the browser.

Solution:

  • Clear your browser cache
  • Try a different browser
  • Use an incognito/private window
  • Sign out and sign back in

Sync Issues with OneDrive

If you have the Site Pages library synced to your computer through OneDrive, file locking can get weird.

Solution:

  • Stop syncing the Site Pages library
  • Make changes through the browser only
  • News pages don’t need to be synced anyway

Wrapping Up

The “file is locked for shared use” error in SharePoint Online usually comes down to one simple issue: trying to do something with an unpublished page that requires the page to be published.

In my case, and probably in yours, the fix was just clicking that Publish button.

Do let me know in the comment below if this solution fix the error for you.

You may also like the following tutorials:

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App