informationsea / xlsxwriter-rs

Excel file writer for Rust
https://crates.io/crates/xlsxwriter
Apache License 2.0
265 stars 44 forks source link

Formula value not visible in spreadsheet when loading #25

Closed manfredlotz closed 2 years ago

manfredlotz commented 2 years ago

Sorry, if this is a stupid question.

This is Linux, Rust is 1.57.0 and xlswriter is newest. I did the following

    workbook.define_name("Serial", "=12315689");
  ...
       sheet1.write_formula(3, 0, "=Serial", None);

When loading the xlsx file with libreoffice the value of cell A4 is 0.

Is this just works as designed or is it an error in the underlying xlswriter C library?

My understanding was that when loading the document with libreoffice (or similar software) the formula gets calculated.

manfredlotz commented 2 years ago

Oops, I just found that this can be setup in libreoffice Tools/Options... and then

LibreOffice Calc / Formula / Recalculation on File Load / Excel 2007 and newer. Now set to Always recalculate