Page 1 of 1

LibreOffice Connect

Posted: Wed Jun 15, 2011 12:49 pm
by dtom81
Hello!

How can I connect to LibreOffice and open a file with OLEobject?

Like to the OpenOffice with this:

Set oSM = CreateObject("com.sun.star.ServiceManager")

Set oDesk = oSM.createInstance("com.sun.star.frame.Desktop")

Set oDoc = oDesk.loadComponentFromURL("private:factory/swriter", "_blank", 0, arg())

Thanks!

Re: LibreOffice Connect

Posted: Wed Jun 15, 2011 12:51 pm
by RoryOF
Have you tried? Syntax should be the same.

Re: LibreOffice Connect

Posted: Wed Jun 15, 2011 1:12 pm
by dtom81
RoryOF wrote:Have you tried? Syntax should be the same.
Yes. I uninstalled the OpenOffice and Install the LibreOffice and it doesn't work.

Re: LibreOffice Connect

Posted: Wed Jun 15, 2011 1:20 pm
by RoryOF
Can you / File / Insert Object : Ole Object directly in a file. If not, the functionality may not be there.

Re: LibreOffice Connect

Posted: Wed Jun 15, 2011 1:27 pm
by dtom81
RoryOF wrote:Can you / File / Insert Object : Ole Object directly in a file. If not, the functionality may not be there.

You are right!
I tried it another machine where I installed only the LibreOffice and it's work!

Thank you!

Re: LibreOffice Connect

Posted: Wed Jun 15, 2011 1:32 pm
by RoryOF
In that case, I suggest removing LibreOffice and OpenOffice traces using Revo Uninstaller at its most aggressive settings, then reinstalling LibreOffice.

Re: LibreOffice Connect

Posted: Mon Feb 20, 2017 4:47 pm
by dhlocker
Final update. Installed LibreOffice 5.2.5.1 and the problem seems to have been resolved.

============8<----- previous post follows ----->8==========
Top-posting what may be an answer, though sad. <https://ask.libreoffice.org/en/question ... eoffice-5/> indicates that x64 fails but x86 succeeds. Manually invoked, the .exe runs fine.

============8<----- original post follows ----->8==========
I find myself a latecomer to this problem.

Windows 7 Professional; SP1; 64-bit.
LibreOffice Version: 5.1.3.2 (x64)
Build ID: 644e4637d1d8544fd9f56425bd6cec110e49301b
CPU Threads: 8; OS Version: Windows 6.1; UI Render: default;
Locale: en-US (en_US)

I find suitable cross-references from HKEY_CLASSES_ROOT\com.sun.star.ServiceManager to an HKEY_CLASSES_ROOT/CLSID/{<signature>}/LocalServer32 whose value is "C:\Program Files\LibreOffice 5\program\soffice.exe --nodefault --nologo" and whose other keys and values look right.

To my knowledge, this machine has not had OpenOffice on it, only LibreOffice. Insert->Object->OLE Object->[I chose LibreOffice 5.1 Drawing] worked as expected, but my diff-odt.vbs script (for TortoiseHg diff) runs OK until

Code: Select all

On Error Resume Next
'The service manager is always the starting point
'If there is no office running then an office is started
Set objServiceManager = Wscript.CreateObject("com.sun.star.ServiceManager")
If Err.Number <> 0 Then
    Wscript.echo "diff-odt: You must have OpenOffice installed to perform this operation." & _
                  vbCrLf & "(" & Hex(Err.Number) & " " & Err.Description & ")"
    Wscript.Quit 1
End If
when it reports in a popup
diff-odt: You must have OpenOffice installed to perform this operation.
(8000FFFF Could not create object named "com.sun.star.ServiceManager".)
This happens whether LibreOffice is already running or not. All other net searches indicate that this should "just work" if everything else works.