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.