I am using EPPlus to generate Excel documents with validation and conditional formatting. I want to check the length of text in a cell and fill it with a color if it is greater than a specified length. I want this to be done for an entire column.
var address = new ExcelAddress("$A:$A");
var condition = workSheet.ConditionalFormatting.AddExpression(address);
condition.Formula = "=IF(LEN(A1)>25, TRUE, FALSE)";
condition.Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
condition.Style.Fill.BackgroundColor.Color = Color.Green;
When I open the generated excel spreadsheet it displays an error asking to recover data.