Ask Your Question

The lock file could not be created

asked 2020-01-21 22:25:59 +0100

shma_lo gravatar image

Why macro stops with the message "The lock file could not be created for exclusive access by LibreOffice, due to missing permission to create a lock file on that file location or lack of free disk space." ? Windows 10, LO

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-01-22 16:43:13 +0100

erAck gravatar image

The program does not have write permission (or insufficient disk space) in the folder where the document to be opened resides and the lock file is to be created when opening the document.

As we don't know what your macro does we can't answer why it stops. LibreOffice itself when opening files from a read-only location can cope with the situation that it can't create a lock file.

edit flag offensive delete link more


Macro stops while executing these lines:

UrlConst = "file:///" & sWorkDir & "LineConst.ods"

oDocConst = StarDesktop.loadComponentFromURL(UrlConst, "_hidden", 0, Dummy())

oDispatcher = createUnoService("")

oFrameConst = oDocConst.CurrentController.Frame

shma_lo gravatar imageshma_lo ( 2020-01-22 21:08:32 +0100 )edit

Are you sure? Dummy() is already an unknown BASIC object. Replace with Array()

If I do that and set sWorkDir to a read-only directory where a LineConst.ods file resides, like


and run the macro then I get the usual LibreOffice message you also cited and if I hit the Open Read-Only button in that dialog it works. On Linux.

erAck gravatar imageerAck ( 2020-01-23 18:11:27 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-01-21 22:25:59 +0100

Seen: 43 times

Last updated: Jan 22