Document editing lock not working - how to enable it?

I know that when I open a document for editing, LO creates a lock file in the same folder like " .~lock.myspreadsheet.odt# " and that this is supposed to cause a warning to be generated if I try to open the same document from another computer.

But for me it doesn’t work. The lock file gets created, but I can open one document with several computers without getting a “document locked” message. And I can then absent-mindedly edit the document on several different computers, which causes a lot of problems. I am using Windows 11 on all the relevant computers.

How do I enable document locking in LO?

And these computers are connected and known via a network?

Is the document on a server?

This is most strange. If there is a lockfile next to the document, the default is to check it.

  1. Are you using LibreOffice to open the documents on all the computers? Can’t it be, that you use e.g. MS Office on other systems?
  2. In OptionsLibreOfficeAdvanced, click Open Expert Configuration, and search for lock. Check the values, especially UseDocumentOOoLockFile. Are they as shown?

They are in a folder of my Microsoft OneDrive cloud storage.

I suppose it might be a problem with synching the OneDrive folder between computers?

So - you are working on a local directory, which gets synchronized with a cloud storage, using MS software and some unknown rules? I would guess, that the synchronizing software simply ignores the lockfile?

It might be that the synchronising ignores the lock files - let me test that out tomorrow and get back you.

OK, the problem seems to be that OneDrive isn’t synchronising the hidden lock file. It appears that if Windows is set to not show hidden files, then OneDrive doesn’t synch them. But after getting the hidden lock files to show on both computers, OneDrive still doesn’t upload the lock file. The file list in File Explorer looks like this,


Microsoft help helpfully says this:
“Files with this icon won’t sync
78444804-7e2a-417a-b19f-95e65392c582 You may see this icon if you sign in to OneDrive with a work or school account. It means your admin has blocked the sync of certain file types. It’s most common to block Outlook data files. If you also sign in to OneDrive with a personal account, the same restrictions will apply.”

The last restriction applies to me, I sign into OneDrive with a personal account.

I asked the question on the Microsoft support forum and was told “Regarding the files you marked with a red arrow starting with. ~lock at the beginning, they are invalid file names and OneDrive will not synchronize them.”


This appears to me to be a bit of a problem for LibreOffice. I can’t be the only person using LO with OneDrive, surely?

No it isn’t a problem for LibreOffice. Any use of file synchronization requires care; try using e.g. Paint on a shared BMP. LibreOffice has lockfiles not for synced directories, and copying the lockfiles is just a hack that you use to workaround the inherent sync technology lack of locking.

You may use MS Office lockfiles, though.

1 Like