Skip to content
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

Fix: make newer Excel versions properly recalculate formulas on docum… #515

Closed
wants to merge 3 commits into from

Conversation

tmarti
Copy link

@tmarti tmarti commented May 28, 2018

This is:

- [x] a bugfix
- [ ] a new feature

Checklist:

Why this change is needed?

Fixes #456 (make newer Excel versions properly recalculate formulas when opening document).

@criztovyl
Copy link
Contributor

Travis seems to disagree with you about whether code-style is respected ^^

IIRC a phpcs fix should fix the remaining style issues.

@tmarti
Copy link
Author

tmarti commented May 28, 2018

Oh my, the additional commit enworsened it ^^.

Letme fix it tomorrow 🙏

@criztovyl
Copy link
Contributor

No stress, choose your pace. :)

@tmarti
Copy link
Author

tmarti commented May 29, 2018

Finally!

Used great tool https://devhub.io/repos/stephpy-vim-php-cs-fixer.

@PowerKiKi PowerKiKi closed this in b700614 Jun 10, 2018
billblume pushed a commit to billblume/PhpSpreadsheet that referenced this pull request Jun 12, 2018
Dfred pushed a commit to Dfred/PhpSpreadsheet that referenced this pull request Nov 20, 2018
oleibman added a commit to oleibman/PhpSpreadsheet that referenced this pull request Dec 11, 2024
Fix PHPOffice#4269. In response to issue PHPOffice#456 PR PHPOffice#515, `forceFullCalc` was added to workbook.xml whenever `preCalculateFormulas` was set to false. It is not clear why this should have been needed; attempts to reproduce the error in the original 6.5-year-old issue are unable to reproduce it today. Nevertheless, it is, or was, there for a reason.

Today, the forceFullCalc option sets an option where formulas *might* not be recalculated when a cell used in the formula changes. I have not succeeded in finding a situation where it doesn't automatically recalculate, but it probably exists on complicated spreadsheets. To overcome this possibility, Excel offers a button which can be used to recalculate on demand. By itself, this might not be a terrible problem. However, it seems to come with the strange property that any spreadsheets opened at the same time as a forceFullCalc spreadsheet operate as if they too specified forceFullCalc. That *is* a problem, especially since users when closing a spreasheet affected in this way will be prompted to save it even when they haven't changed anything.

I am not willing to make a BC change at this time, although I might consider it in future (PR PHPOffice#4240). For now, I am adding a new property `forceFullCalc` with setter (no getter needed) to Xlsx Writer. That property can be `null` (default, in which case the Xml attribute is set as today), or `false` or `true` (in which case the Xml attribute will be set to the Writer attribute). I think that, when `preCalculateFormulas` is set to false, the calling application should give consideration to setting `forceFullCalc` to false as well. All other situations should just use the default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants