I am using libreoffice for batch conversion .xls -> .html. Script attached. When HOME directory is not set everything works OK (strace is ss.OK.txt) soffice_auto -calc -nologo -nofirststartwizard -view -norestore -headless -nolockcheck -unaccept=all 'macro:///Tools.ModuleConvertFile.SaveAsHTML("/tmp/nybits_anytohtml_a9_UoGY.xls","/tmp/nybits_anytohtml_a9_UoGY.xls.html","HTML (StarCalc)")' but when HOME is set to some directory in /tmp/ the conversion fails (strace is ss.FAIL.txt) there was no such problem in openoffice. where soffice_auto is just a direct call of soffice.bin cat /usr/local/bin/soffice_auto #!/bin/bash #/bin/rm -f /tmp/OSL_PIPE* #strace /usr/lib64/libreoffice/program/soffice.bin "$@" exec /usr/lib64/libreoffice/program/soffice.bin "$@"
Created attachment 526525 [details] strace logs strace log
Created attachment 526526 [details] A script to convert any .xls to .html
I cannot reproduce this with a recent master build of LibO (towards LibO 3.5). However, what you should always do is call soffice instead of soffice.bin.
...but can indeed reproduce it with the LibO 3.3.3 in f15
we bumped f15 to LibO 3.3.4.1-1.fc15, is this still an issue ?
Still exist in libreoffice-core-3.4.4.2-7.fc16.x86_64 This is an extremely annoying bug - I cannot use libreoffice as a batch converter of files.
I can no longer reproduce this, neither with a current build of vanilla libreoffice-3-4 (towards LO 3.4.6) nor with libreoffice-core-3.4.4.2-6.fc16.x86_64, but I'm not entirely sure I try to reproduce it in a way that is relevant to what fails for the submitter, nor in the same way I tried to reproduce it last October. What I tried now is, with a /tmp/test.xls created: > rm -rf ~/.libreoffice > soffice # "Tools - Macros - Organize Macros - LibreOffice Basic... - Macro from - # My Macros - Standard - Module1 - Edit", paste (de-XML-ified) text content # of <script:module> of attached ModuleConvertFile.xba, Save and Quit > soffice -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")' > rm /tmp/test.xls.html # no error (i.e., file had been written) > mkdir /tmp/HOME > HOME=/tmp/HOME soffice # "Tools - Macros - Organize Macros - LibreOffice Basic... - Macro from - # My Macros - Standard - Module1 - Edit", paste (de-XML-ified) text content # of <script:module> of attached ModuleConvertFile.xba, Save and Quit > HOME=/tmp/HOME soffice -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")' > rm /tmp/test.xls.html # no error (i.e., file had been written)
"Need Real Name," also not sure why you want to set HOME to some temp dir in the first place. Are you aware of soffice -env:UserInstallation=file:///tmp/foo to let soffice use a non-standard user configuration directory (instead of the default ~/.libreoffice)?
in rpm -q libreoffice-core libreoffice-core-3.4.4.2-7.fc16.x86_64 it is still does not work cd /tmp/ soffice -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")' test.xls is successfully converted to test.xls.html rm test.xls.html mkdir /tmp/K ; export HOME=/tmp/K/ soffice -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")' no test.xls.html created echo $? 0 /usr/lib64/libreoffice/program/soffice.bin -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")' same thing strace /usr/lib64/libreoffice/program/soffice.bin -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")' >/tmp/diag.txt 2>&1 the reason I need to have HOME= set is to run 10-20 soffice at once in background for batch processing. soffice does some user account locking, and setting HOME= was the only reliable way to achieve this. I used all version of soffice and early versions of openoffice without a problem.
Created attachment 556814 [details] strace log diag attached ls -lstrAF /tmp/K/ total 4 4 drwxrwxr-x. 3 mal mal 4096 Jan 22 14:16 .libreoffice/ strace /usr/lib64/libreoffice/program/soffice.bin -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")' >/tmp/diag.txt 2>&1
In F17 The script stopped working at all. libreoffice-calc-3.5.2.1-6.fc17.x86_64 strace /usr/lib64/libreoffice/program/soffice.bin -calc -nologo -nofirststartwizard -view -norestore -headless -nolockcheck -unaccept=all 'macro:///Tools.ModuleConvertFile.SaveAsHTML("/tmp/nybits_anytohtml_C4dpWHs.xls","/tmp/nybits_anytohtml_C4dpWHs.xls.html","HTML (StarCalc)")' consumes 100% CPU and no results in 10 minutes.
Created attachment 584985 [details] strace attached strace attached
re comment 9: Where is your SaveAsHTML BASIC code stored? Because, if it is stored under "My Macros - Standard - Module1" (see "Tools - Macros - Organize Macros - LibreOffice Basic..."), then it of course won't be available to LibreOffice if you change HOME. Just to clarify... re comment 11: The script still works fine for me on F17.
I put the script to /usr/lib64/libreoffice/share/basic/Tools/ModuleConvertFile.xba because it need to be available for all users and edited /usr/lib64/libreoffice/share/basic/Tools/script.xlb to add it to the list. The script did not work at all after F17 install. No matter with HOME=/tmp/ set or unset. Now the script works again. Also it now started to work with HOME=/tmp/tempdir/ set!!! rpm -q --last libreoffice-calc libreoffice-calc-3.5.4.2-1.fc17 Sat 09 Jun 2012 05:31:13 AM EDT It definitely did not work a month ago. Something very strange.
(In reply to comment #14) > Also it now started to work with HOME=/tmp/tempdir/ set!!! So I understand we can close this as NOTABUG now. (Feel free to reopen if a scenario comes up that still does not work.)
Yes. Looks this bug was fixed probably at libreoffice-calc-3.5.4.2-1.fc17 update.