socketscmdopenoffice.orglibreofficesoffice

soffice socket is not opening via commandline


I wana use the pyoo.py package to control libreOffice via Python.

There are good tutorials available. First step is to open a socket with following command.

soffice --nologo --norestore --nodefault --accept="socket,host=localhost,port=2002;urp;"

But it does not work, it stucks.(Stucks means I enter the command in the cmd but no response) If I kill the sOffice Process in the Task-Manger it will continue.

It worked once and than never again.

I use Win7 64bit and LibreOffice 5


Solution

  • First be sure that all instances and processes of soffice are closed, because if office is already open, it will not start listening on a socket.

    Well there is something wrong with your command; it isn't working for me. What I normally use is:

    chdir "%ProgramFiles(x86)%\LibreOffice 5\program\"
    start soffice -accept=socket,host=0,port=2002;urp;
    

    On Linux I use the following command, and the same arguments work on Windows:

    loffice "--accept=socket,host=localhost,port=2002;urp;" --writer
    

    EDIT:

    From your comment, it sounds like you were able to get it to work by removing various arguments to see which one was causing the problem.