The lock file could not be created

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 6.2.7.1.

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.

Macro stops while executing these lines:

UrlConst = “file:///” & sWorkDir & “LineConst.ods”

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

oDispatcher = createUnoService(“com.sun.star.frame.DispatchHelper”)

oFrameConst = oDocConst.CurrentController.Frame

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

sWorkdir="home/user/readonly/"

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.