EPPlus icon indicating copy to clipboard operation
EPPlus copied to clipboard

Fix issue #152 Posibility to ignore Microsoft Excel cells warning errors, like "Number Stored as Text" or "Two Digit Text Year"

Open romcode opened this issue 6 years ago • 1 comments

This pull request fix the issue #152 , adding to EPPlus the posibility to ignore Microsoft Excel cells warning errors, like "Number Stored as Text" or "Two Digit Text Year"

Following briddums advise ( https://stackoverflow.com/users/260473/briddums ), as himself explained in https://stackoverflow.com/questions/11858109/using-epplus-excel-how-to-ignore-excel-error-checking-or-remove-green-tag-on-t/14483234#14483234 , the best way to address this issue is adding a whorksheet property that allows to ignore the warnings in a specified range.

        ExcelWorksheet worksheet = package.Workbook.Worksheets.Add("WhorksheetSample");
		
        // Set the cell range to ignore errors on to the entire worksheet
        worksheet.IgnoredError.Range = worksheet2.Dimension.Address;

        // Do not display the warning 'number stored as text'
        worksheet.IgnoredError.NumberStoredAsText = true;

I added a sample use case to this commit.

I would like it, but I coudn't added a test case to the commit, as I didn't find a way to check if the cell contains a warning.

Would you mind to merge this pull request?

Best regards.

romcode avatar Sep 04 '19 08:09 romcode

HI @EPPlus, any chance to merge this fix/pull request ? Thank you!

romcode avatar Nov 04 '19 18:11 romcode