[Solved] "XXX" File Locked For Editing - Mac

Discuss the spreadsheet application
Post Reply
3ME
Posts: 91
Joined: Wed Oct 08, 2008 6:12 am
Location: Chicago

[Solved] "XXX" File Locked For Editing - Mac

Post by 3ME »

Suddenly when I try to open an ods Calc spreadsheet that has existed on my Mac network for quite some time, I get a message telling me that my user has locked the file and only gives me an option to open a Read Only or Copy. Now if I change the name of the file, I can open it fine. So what has happened to the original file with the orig name and how can I fix it on a Mac? I see similar situations on here in a search but all apply to Windows.
Last edited by RoryOF on Sat May 02, 2015 5:39 am, edited 1 time in total.
Reason: Added [Solved] and green tick.[RoryOF, Moderator]
OOo 4.1.7 on Mac OSX Catalina
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: "XXX" File Locked For Editing - Mac

Post by Villeroy »

When the program loads a document, a so called lock file is created. The lock file will be deleted when the program closes the file properly. Only one (network-)user can have write access to a document.
If there is nobody else who has this file loaded, your office may have crashed or the system may have shut down before the office could terminate properly so the lock file is still there. Close the file and delete the corresponding lock file.
Spreadsheet and its lock file
Spreadsheet and its lock file
LockFile.png (9.21 KiB) Viewed 16189 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
3ME
Posts: 91
Joined: Wed Oct 08, 2008 6:12 am
Location: Chicago

Re: "XXX" File Locked For Editing - Mac

Post by 3ME »

Can you please tell me where I can find the lock file on a Mac?
OOo 4.1.7 on Mac OSX Catalina
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: "XXX" File Locked For Editing - Mac

Post by Villeroy »

It is a file in the same directory as the document file. Possibly you have to change some option to unhide any hidden files.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
3ME
Posts: 91
Joined: Wed Oct 08, 2008 6:12 am
Location: Chicago

Re: "XXX" File Locked For Editing - Mac

Post by 3ME »

Worked like a charm!... now that I understand what's going on and what to do. Thank you very much Villeroy!

For future Mac users, here are the instructs...

Open Terminal found in Finder > Applications > Utilities
In Terminal, paste the following: defaults write com.apple.finder AppleShowAllFiles YES
Press return
Hold ‘alt’ on your keyboard, then right click on the Finder icon in the dock and click Relaunch.
In finder, go to the folder where the problem doc exists.
Delete: .~lock.(Doc Name).ods#
To hide hidden files again, paste the following in Terminal: defaults write com.apple.finder AppleShowAllFiles NO
Press return
Hold ‘alt’ on your keyboard, then right click on the Finder icon in the dock and click Relaunch.
Last edited by 3ME on Sat May 02, 2015 5:42 am, edited 1 time in total.
OOo 4.1.7 on Mac OSX Catalina
User avatar
RoryOF
Moderator
Posts: 35266
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] "XXX" File Locked For Editing - Mac

Post by RoryOF »

Usually, a left over lock file is indicative of either a program/operating system crash, or too speedy a close down of the computer after exiting OpenOffice.
Apache OpenOffice 4.1.16 on Xubuntu 26.04.1 LTS
Post Reply