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

Problem reading cells with some types of formulas #22

Closed
IsakNaslundBh opened this issue Apr 19, 2023 · 0 comments · Fixed by #23
Closed

Problem reading cells with some types of formulas #22

IsakNaslundBh opened this issue Apr 19, 2023 · 0 comments · Fixed by #23
Assignees
Labels
type:bug Error or unexpected behaviour

Comments

@IsakNaslundBh
Copy link
Contributor

IsakNaslundBh commented Apr 19, 2023

Description:

Reading from some cells with formulas in them leads to a crash in the closed xml package when trying to access the value. By my quick investigation, it looks like accessing the Value property of the IXLCell means the cell value is re-computed making use of some mechanism in the closedXML repo, and that it fails to do so if the cell contains certain formulas.

A way around this is to instead fetch the CashedValue, or potentially just fallback to this, by first calling the TryGetValue and if that fails, fall back to the CashedValue.

Steps to reproduce:

Will produce testfile that illustrates the issue.

Expected behaviour:

For sheets with formulas to pull, giving back the value in the cell, could be pre-computed, or live computed.

Test file(s):

Will raise PR and provide there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error or unexpected behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant