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

Copying cell with certain formula results in corrupt cell #107

Closed
Floopy-Doo opened this issue Nov 23, 2016 · 2 comments
Closed

Copying cell with certain formula results in corrupt cell #107

Floopy-Doo opened this issue Nov 23, 2016 · 2 comments

Comments

@Floopy-Doo
Copy link

Floopy-Doo commented Nov 23, 2016

Hi

I found an issue with while trying to copy a cell with a valid FormulaA1 to a different cell. Then copying works just fine but when I try to access formula in the copied cell I get an System.FormatException.
This exception is thrown on the FormulaA1, HasFormula and the Value property of the cell. Intrestingly the FormualR1C1 returns a value.

My guess there might be an issue in manipulating the formula on copy.

Here my code for reproduction:

FileInfo file = new FileInfo("Testfile.xlsx");
using (FileStream stream = file.OpenRead())
{
    using (XLWorkbook workbook = new XLWorkbook(stream))
    {
        IXLWorksheet workSheet = workbook.Worksheet("Sheet1");

        workSheet.Cell("B44").Value = workSheet.Cell("A44");

        Debug.WriteLine(workSheet.Cell("B44").HasFormula);
    }
}

The Excelfile is an empty file with this formula in the cell A44:
=IF(A9="Tender";0;(A72-(A62+A63+A65+A67+A69))*A17)

Thanks for your help in advance.

@Floopy-Doo Floopy-Doo changed the title Copying cell with formula results in corrupt cell Copying cell with certain formula results in corrupt cell Nov 23, 2016
@igitur
Copy link
Member

igitur commented Nov 23, 2016

Thanks. This is a duplicate of #40 . A PR was submitted at #41 , but I was waiting for a suitable test case.

@Floopy-Doo
Copy link
Author

Thanks for the answer. Any ETA for the next version where to bug would be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants