Why is EPPlus telling me that I “Can’t set color when patterntype is not set” when I have set PatternType?

Look closely at the two lines:

worksheet.Cells["A32:D32"].Style.Fill.PatternType = ExcelFillStyle.Solid;
worksheet.Cells["A32:D33"].Style.Fill.BackgroundColor.SetColor(Color.CornflowerBlue);

The second line has D33 instead of D32 so if D33 is not set yet it would throw that error.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)