Problem opening an .xlsx file via LibreOffice's COM interface

Get help with using AutoHotkey and its commands and hotkeys
Posts: 4
Joined: 22 Jul 2018, 14:19

Problem opening an .xlsx file via LibreOffice's COM interface

10 Jul 2019, 10:07


I want to open an .xlsx file using LibreOffice. But when I specify "ReadOnly" argument to loadComponentFromURL I get
Error: 0x800405E9 from "automation bridge".

I need to use ReadOnly mode to avoid the popup that is shown each time the file is locked by other process.
Here is my code.

Code: Select all

serviceManager := ComObjCreate("")

desktop := serviceManager.createInstance("")

anArray := ComObjArray(VT_VARIANT, 2)
anArray[0] := MakePropertyValue(serviceManager, "Hidden", VT_BOOL, True)
anArray[1] := MakePropertyValue(serviceManager, "ReadOnly", VT_BOOL, True)
document := desktop.loadComponentFromURL("file:///" . destPath, "_blank", 0, anArray)

sheet := document.getSheets().getByName("Sheet1")
Without ReadOnly attribute the code runs fine.
Anybody here managed to run loadComponentFromURL with ReadOnly=True ? Any ideas?


[Mod edit: Topic name added]

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], guest3456, LuanMts and 35 guests