In ExcelWriter versions prior to 6.6.1, setting conditional formatting with the API does not work properly with .NET 2.0. The functionality works correctly with .NET 1.1 and 1.0. If your virtual application is set to run on .NET 2.0, calling the SetConditionalFormat() method will generate a corrupt file which can not be opened in Excel.
Here is an example of code which can cause Microsoft Excel to fail:
ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Create();
Worksheet ws = wb.Worksheets.CreateWorksheet("SampleSheet");
/* we create the area to which our sample conditional format
will apply */
Area sampleArea = ws.CreateArea(1,1,0,0);
ConditionalFormat sampleFormat = wb.CreateConditionalFormat();
Condition sampleCondition = sampleFormat.
CreateCondition(Condition.Comparison.CellValueLessThan,”100”);
sampleArea.SetConditionalFormat(sampleFormat);
After running this code, Microsoft Excel is not able to open the output file and may generate the following error:

|