Troubleshooting “SharePoint: The file is currently checked out by another user.”

This error occurs when Power Query tries to refresh data from an Excel workbook, CSV, or document stored in SharePoint Online or OneDrive, but SharePoint has placed an exclusive editing lock on the file. If a team member has manually checked out the file, opened it in a legacy desktop version without co-authoring, or closed it while a synchronization hold was active, SharePoint blocks external read and refresh requests.

Quick Answer

Open the SharePoint document library in your web browser, locate the source file, click the three-dot menu (…), and select Check in or Discard check out. If you do not have permission to override the user lock, have a SharePoint Site Owner release the checkout or check in a minor version.


Why SharePoint Locks Source Files

SharePoint document libraries manage multi-user access through two mechanisms: Co-authoring and Check-Out.

When co-authoring works normally, multiple people can read and write to an Excel file simultaneously, and Power Query can pull the latest saved state. However, the check-out mechanism enforces an exclusive write lock. While a file is checked out:

  • Changes made by the user remain isolated in a staging draft.
  • Other users and automated services (including the Power Query engine) cannot read the working draft.
  • If no prior version was checked in, Power Query cannot access the file at all, throwing: "SharePoint: The file is currently checked out by another user."

Step-by-Step Diagnostic and Resolution Path

Step 1: Check In or Discard the Checkout in SharePoint

If you know who checked out the file:

  1. Navigate to the SharePoint document library in your web browser.
  2. Look at the file icon. A small red or green arrow over the document icon indicates a checked-out status.
  3. Hover over the icon to see which user currently holds the checkout.
  4. If that user is available, ask them to check the file in:
    • Select the file > Click … (More actions) > Advanced (or Version history) > Check in.
    • Choose to check in as a Minor version (draft) or Major version (publish).
┌────────────────────────────────────────────────────────┐
│  Documents > Financial_Reports                         │
├────────────────────────────────────────────────────────┤
│  [XLSX] Q3_Forecast.xlsx  [Checked Out to: jsmith]     │
│         │                                              │
│         ├── Open in Browser                            │
│         ├── Share                                      │
│         └── More > Check in / Discard check out ◄───── │
└────────────────────────────────────────────────────────┘
Step 2: Site Owner Override (For Orphaned Locks)

If the user is out of office or their session crashed:

  1. A user with Full Control or Site Owner permissions must open the library.
  2. Click the gear icon (Settings) in the top-right corner and select Library settings.
  3. Select More library settings, then click Manage files which have no checked in version.
  4. If the target file appears here, select it and click Take Ownership of Selection, then check it in or discard the checkout.
  5. If the file is visible in the standard view, right-click the file, select More, and choose Discard check out. This clears the lock immediately.
Step 3: Audit the “Require Check Out” Library Policy

If this error happens repeatedly across different files in the same folder, your document library is likely configured to require check-outs automatically.

  1. In the SharePoint document library, go to Settings > Library settings > More library settings.
  2. Under General Settings, click Versioning settings.
  3. Scroll down to Require Check Out.
  4. Check if “Require documents to be checked out before they can be edited?” is set to Yes.
  5. When set to Yes, co-authoring is completely disabled, and any user opening the file in desktop Excel creates a hard lock that blocks Power Query refreshes.
  6. If your workflow relies on automated refreshes, change this setting to No (requires Site Administrator rights).

Step 4: Switch Connector Methods in Power Query

How you connect to SharePoint affects how locks are handled:

  • The Web Connector (Web.Contents): Direct URLs treat the file like a raw HTTP resource and fail immediately if a checkout flag is present.
  • The SharePoint Connector (SharePoint.Files or SharePoint.Contents): This connector communicates directly with the SharePoint REST API. It can read the last checked-in major version of a file even if someone currently has a draft checked out.

If you are using a raw web link in your M-code, re-point the query to the native SharePoint connector:

Source = SharePoint.Files("<https://company.sharepoint.com/teams/FinanceTeam>", [ApiVersion = 15])

Filter by the file name in the Name column, then click the binary content icon to extract the table. This bypasses active draft locks by reading the published historical version.


Deeper Issues: Ghost Locks and Sync Conflicts

If the file shows as checked in on the web interface, but Excel continues returning the checkout error, an open connection is stuck in a local synchronization cache.