-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workbook formulas are not recalculated on opening in Excel #427
Comments
I see, you can click F2 on the cell to get the formula reevaluated. Not sure at the moment, if there is a way to tell excel to reevaluate all formulas. I'll look into it. |
Maybe we need to keep |
I have opened #428 this should fix the issue. It is caused by calculation properties in combination with a calculation chain. Excel uses this when writing xlsx files to let Excel know in which order cells need to be evaluated. |
Many thanks, that makes sense! |
Thanks for reporting! Things like this are difficult to spot - more than a year went by without anyone noticing, because they occur only in a very specific set of conditions - and they cause even harder headaches later on. |
No problem -- happy to help. On your earlier comment to use |
You can use fl <- "test_calculation.xlsx"
wb <- wb_load(fl)$
add_data(dims = "A1", x = "Beta")$
open()
wb <- wb_load(fl) %>%
wb_add_data(dims = "A1", x = "Beta") %>%
wb_open() |
After amending an existing workbook in
openxlsx2
, formulas are not recalculating on opening the amended workbook in Excel. As a consequence, formula results remain wrong (and are quite difficult to get Excel to recalculate, too). I would argue that all workbooks saved byopenxlsx2::wb_save()
should be set to recalculate on opening in Excel.To reproduce:
openxlsx2::wb_load()
andopenxlsx2::write_data()
, save viaopenxlsx2::wb_save()
test_calculation.xlsx
test_calculation_result.xlsx
The text was updated successfully, but these errors were encountered: