Frequently Asked Question

the doucment was saved successfully, but Excel cannot re-open it becuase of a sharing violation. please close the document and try to open it again
Last Updated 2 hours ago

This message usually means Excel saved the workbook, but could not immediately open it again because the file was still locked by Windows, the Nextcloud sync client, antivirus software, or a leftover temporary file.

The problem is commonly temporary, but if it happens regularly the steps below usually identify the cause.

Quick fix

Try these steps first:

  1. Close Excel completely.
  2. Wait 10 to 30 seconds.
  3. Open the file again from File Explorer, not from Excel’s Recent list.

If the file opens normally, the cause was most likely a short-lived file lock.

Most common cause with Nextcloud Sync

When a workbook is saved inside a Nextcloud-synchronised folder, Excel may finish saving but Nextcloud may still be processing the changed file. During that short period, Excel can fail to reopen it and report a sharing violation.

To test this:

  1. Right-click the Nextcloud icon in the Windows system tray.
  2. Pause synchronisation.
  3. Open the Excel workbook.
  4. Save it.
  5. Close it.
  6. Reopen it while synchronisation is still paused.

If the problem disappears while sync is paused, the Nextcloud desktop client is likely involved.

Check for a temporary Excel lock file

Excel creates temporary files while a workbook is open. If one of these remains behind after Excel has closed, it can block the file from reopening.

  1. Open the folder containing the workbook.
  2. Look for a file whose name starts with ~$.

Example:

~$Budget.xlsx
  1. Confirm Excel is fully closed.
  2. Delete the ~$ file if it is still present.
  3. Open the workbook again.

Do not delete the main workbook itself, only the temporary file beginning with ~$.

Make sure Excel is fully closed

Sometimes Excel remains running in the background even after the window is closed.

Check in Task Manager

  1. Press Ctrl + Shift + Esc.
  2. Open Task Manager.
  3. Look for any running Excel or Microsoft Excel process.
  4. End the task if Excel should no longer be open.
  5. Try opening the workbook again.

Open the file from File Explorer

Opening from Excel’s Recent list can occasionally point to a stale handle or trigger a reopen too quickly after save.

Use this method instead:

  1. Open File Explorer.
  2. Browse to the local Nextcloud folder.
  3. Double-click the workbook directly.

Check whether someone else has the file open

If the file is stored in a shared Nextcloud folder, another user may already have it open, or a sync conflict may be developing.

Check for:

  • Another user editing the file
  • A file marked as in use
  • Duplicate or conflicted copies in the folder
  • Recent edits from another device

If multiple people need to work in the same workbook, this can increase the chance of lock conflicts.

Test with a new workbook

This helps determine whether the issue is with one workbook or with the folder, sync client, or Windows environment.

  1. Create a new Excel workbook in the same Nextcloud folder.
  2. Save it.
  3. Close it.
  4. Reopen it.

If the new workbook works

The original workbook may be the problem. Possible causes include:

  • Workbook corruption
  • Complex formulas, links, or add-ins
  • Macros or external data connections
  • Embedded content holding the file open

If the new workbook fails in the same way

The cause is more likely to be:

  • Nextcloud sync locking
  • Antivirus scanning
  • Windows file protection
  • A broader Office or sync client issue

Test antivirus or endpoint protection

Real-time scanning can briefly lock Office files immediately after they are saved.

To test:

  1. Temporarily pause or disable real-time antivirus scanning, if permitted by company policy.
  2. Try saving and reopening the workbook again.

If the issue stops, add the local Nextcloud sync folder to the antivirus exclusions list.

Common example path:

C:\Users\<username>\Nextcloud\

Only make security changes in line with organisational policy.

Test Windows ransomware protection or Controlled Folder Access

Windows security features can interfere with Office applications writing to synchronised folders.

To test:

  1. Open Windows Security.
  2. Go to Virus & threat protection.
  3. Open Ransomware protection.
  4. Temporarily disable Controlled folder access, or allow Excel and Nextcloud through it.
  5. Test the workbook again.

If this resolves the issue, configure an exception rather than leaving the feature disabled.

Update Office and the Nextcloud desktop client

Older versions of Excel or the Nextcloud client can cause file lock timing issues.

Update Microsoft Office

  1. Open Excel.
  2. Go to File > Account.
  3. Select Update Options > Update Now.

Update Nextcloud Desktop

  1. Open the Nextcloud desktop client.
  2. Check for available updates.
  3. Install the latest version.
  4. Restart Windows after updating.

Restart the Nextcloud client

If the sync client has become stuck or is holding file handles open, restarting it often clears the condition.

  1. Right-click the Nextcloud icon in the system tray.
  2. Exit the client completely.
  3. Start Nextcloud again from the Start menu.
  4. Allow it to settle.
  5. Test the file again.

Restart Windows

If the file lock is held by a background process and is not obvious, a restart can clear it.

Use this when:

  • Excel has been closed but the file still will not reopen
  • The ~$ file returns repeatedly
  • Nextcloud has been paused or restarted and the problem remains

If the issue affects one file only

Where only one workbook is affected, try repairing it:

  1. Open Excel first.
  2. Use File > Open.
  3. Browse to the file.
  4. Select the workbook.
  5. Use the arrow next to Open.
  6. Choose Open and Repair.

If it opens, save it as a new file name in the same folder and test again.

If the issue happens every time in Nextcloud folders

A practical workaround is to edit the file outside the synchronised folder and then copy it back once finished.

Example workflow:

  1. Copy the workbook to a local non-synchronised folder such as:
C:\Temp\
  1. Edit and save it there.
  2. Close Excel.
  3. Copy it back into the Nextcloud folder.

This avoids immediate sync interference while editing, though it is less convenient and should be used mainly as a temporary measure.

Summary

The error usually comes from a temporary file lock after saving. The most effective checks are:

  • Close Excel and wait briefly before reopening
  • Open the file from File Explorer
  • Pause Nextcloud sync and test again
  • Delete any leftover ~$ lock file after Excel is closed
  • Check for antivirus or Windows security tools locking the file
  • Test with a brand new workbook in the same folder
  • Update Office and the Nextcloud desktop client

If the fault only affects one workbook, the file itself is the likely cause. If it affects all Excel files inside the Nextcloud folder, the sync client or Windows security software is usually responsible.

This FAQ was generated and/or edited by GAIN, GENs Artificial Intelligence Network and should not be considered 100% accurate. Always check facts and do your research, things change all the time. If you are unsure about any information provided, please raise a support ticket for clarification.
This website relies on temporary cookies to function, but no personal data is ever stored in the cookies.
OK
Powered by GEN UK CLEAN GREEN ENERGY

Loading ...