zdavatz / spreadsheet

The Ruby Spreadsheet by ywesee GmbH
http://spreadsheet.ch
GNU General Public License v3.0
1.13k stars 240 forks source link

Formula is missing randomly. #218

Closed safiir closed 6 years ago

safiir commented 6 years ago

Desc

I try to open a excel file, then fill it with some dynamic data, but after the cell is filled and the excel is written to disk, some formula type cell's formula could be missing randomly.

Environment:

Ruby: ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu] Spreadsheet (1.1.5)

Code And File

script for test .xls file for test

zdavatz commented 6 years ago

Interesting. Please provide sample code and file.

safiir commented 6 years ago

@zdavatz The test code and the file have been added. please check it, thanks!

zdavatz commented 6 years ago

Thanks. But we do not support XLSX. I will need an XLS File to test. Also: what software created the original XLS file?

safiir commented 6 years ago

@zdavatz Sorry, I updated the code and the file again, and I created the .xls file in WPS(like Microsoft Excel) for Debian-like Linux.

zdavatz commented 6 years ago

Try creating the file using LibreOffice or OpenOffice, then it should work. I have no idea what WPS is. They probably do not attend to all the format Rules of MS Excel. It makes a big difference to which software created the original file.

zdavatz commented 6 years ago

The output file "filled.xls" is not missing any data AFAICT. filled

safiir commented 6 years ago

@zdavatz The formula in power column is missing instead of current and previous data.

zdavatz commented 6 years ago

I guess you have to write that as well when writing the new file.

zdavatz commented 6 years ago

Have you tried to write just the formulas from one file to another?