# Failure of: soffice.exe -headless -convert-to on windows [closed]

Here is the exact command line I have played with.

C:\"Program Files\LibreOffice 3.6"\program\soffice.exe -headless -convert-to xlsx:"Calc MS Excel 2007 XML" -outdir D:\temp\  D:\temp\test_output_v5.csv


I am trying to convert a csv to xlsx. Where csv is a comma separated list of values, the values double quoted. I do not know if this is possible. I have read that it is.

I have read that you use - instead of -- on windows. I use windows 7 SP 1. I am using the latest version of libreoffice.

I have no other soffice.exe in my processes when i run the above. C:\"Program Files\LibreOffice 3.6"\program\soffice.exe alone fires up soffice.exe , every time. 100%.

The command worked the very first time, and sporadically (~50 runs , 3 success) varying the command line I found a change did not lead to repeated success.

I run this command in a bat file, and on command line.

I have tried also:

Pushd   C:\"Program Files\LibreOffice 3.6"\program\
soffice.exe -headless -convert-to xlsx:"Calc MS Excel 2007 XML" -outdir D:\temp\D:\temp\test_output_v5.csv
popd


So what I have I done wrong?

Thanks

Alex.

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by Alex Kemp close date 2015-10-21 01:50:24.982429

Sort by » oldest newest most voted

I've got two suggestions: Make sure there is a space between soffice.exe and the quote. cmd.exe might miscontrue the line without a space.

Second, I've discovered that the scripting shell on windows 7 does not understand paths with spaces. If you're using that, you need to change the command to "C:\progra~1\libreo~1..." or it will silently fail to run.

Next, check Task Manager for a zombie soffice.exe process. If you have one, the command will again silently fail under the scripting host. An invalid input or output path will often cause soffice to terminate improperly, leaving a zombie that scripting host will try to use, but won't answer, producing yes, another silent failure.

Finally, reboot. About once a month as a full time developer I start having issues that should never happen on any computer ever, for instance, a batch file that ran correctly exactly every other time. A reboot fixed it.

Frank

more