Libreoffice converts html to xls or xlsx

I am trying to use Libreoffice to convert an HTML file to XLS or XLSX format.

With LibreOffice 4.0.4.2 running CentOS 6.5 (Final), I was able to convert plain html to Microsoft XLS with the following command.

soffice --headless --convert-to xls my_file.html

I tested the latest LibreOffice 5.0.4.2 with no success. I use the following command and including the filter:

libreoffice5.0 --headless --convert-to xls: "MS Excel 97" test.html

It returns the following.

convert / path / to / test.html → /path/to/test.xls using a filter: MS Excel 97 Overwrite: /path/to/test.xls Error: Please check the input parameters ... (SfxBaseModel :: impl_store failed: 0xc10)

I have not had success in decoding the error. Any advice on using libreoffice (latest versions) to convert from HTML to XLS / XLSX is appreciated ... as well as other open source tools that can do the exact same thing.

+4
source share
1 answer

As soon as I post a question, how do I solve my problem.

The answer is ... to save you in the future.

libreoffice5.0 --headless --calc --convert-to xls: "MS Excel 97" test.html

  • or easier -

scalc --headless --convert-to xlsx test.html

Works great ... and relatively intuitive.

+2
source

Source: https://habr.com/ru/post/1620807/


All Articles