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:
- Navigate to the SharePoint document library in your web browser.
- Look at the file icon. A small red or green arrow over the document icon indicates a checked-out status.
- Hover over the icon to see which user currently holds the checkout.
- 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:
- A user with Full Control or Site Owner permissions must open the library.
- Click the gear icon (Settings) in the top-right corner and select Library settings.
- Select More library settings, then click Manage files which have no checked in version.
- If the target file appears here, select it and click Take Ownership of Selection, then check it in or discard the checkout.
- 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.
- In the SharePoint document library, go to Settings > Library settings > More library settings.
- Under General Settings, click Versioning settings.
- Scroll down to Require Check Out.
- Check if “Require documents to be checked out before they can be edited?” is set to Yes.
- 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.
- 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.FilesorSharePoint.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.
- Office Upload Center / OneDrive Cache: If the user who last touched the file used the OneDrive sync app, a sync conflict may be holding a ghost lock on the server. Have the user check their Windows system tray for OneDrive or Office sync warnings.
- For handling locked temporary files created during local syncs, see Fixing errors in Folder.Files when a temp file (~$) is open in the folder.
- If your refresh fails consistently when running in cloud environments (such as Excel Online), see Handling “External Data Refresh Failed” on Excel Online / SharePoint.
- For local operating system locks that mimic SharePoint locks, review Troubleshooting “The process cannot access the file because it is being used by another process.”