0

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

Peter
  • 1,629
  • 2
  • 25
  • 45
  • What version of LibreOffice are you using? That command has worked for me on Win7. Have you tried rebooting your machine to make sure there are no processes that are stuck? If that doesn't work then you might need to reinstall LibreOffice. – Jim K Dec 04 '15 at 09:16
  • @JimK yes I tried reboot, and I tried it with 4.X and now I have Version 5 of LibreOffice – Peter Dec 04 '15 at 11:02

1 Answers1

1

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.

Jim K
  • 12,824
  • 2
  • 22
  • 51
  • The options are necessary,cause I want to run it without User interaction. There will be one more option in hte future --headless. The command is from this page https://pypi.python.org/pypi/pyoo/1.0 – Peter Dec 05 '15 at 09:33
  • Does it work on your system without the extra arguments? The extra arguments just make it faster -- I think pyoo will still work with the commands shown in my answer. Once you get it working then you can add `--headless`. – Jim K Dec 05 '15 at 19:59
  • Hei I tried it and figured out that "--nologo" isthe bad guy. Without it works fine. It seems that the sOffice has an issue with that argument in combination with no instance (-calc / -writer etc...) Pls write an Answer so that I can accept it. Thanks for the hint – Peter Dec 06 '15 at 10:57
  • Glad to hear my answer and/or comments helped you solve the problem. I modified the answer to reflect this. – Jim K Dec 07 '15 at 18:34