Closed XML XLConditionalFormat does not support properties like StopIdTrue, Priority, Rank, EqualAverage, StdDev, etc.,
This is crutial because it alters the order and stop-if-true states of the conditional formats in the excel spreadsheet (.xlsx file).
To duplicate the issue. Use MS excel and do the following:
1. Create a xlsx file with many sets of conditional formats, each set doing a format change on a specific range of cells.
2. Set the "Stop if true" property to true, by checking the checkbox. Save this xlsx file.
3. Use "ClosedXML.Excel.XLWorkbook" to load the saved xlsx file; use a variable to load the workbook object (say var wb = ...).
4. Save the workbook as a new workbook, using wb.SaveAs();
5. Open the saved workbook and check the conditional formats. The order is all changed and stop if true is not checked!!
Comments: I seem to be having this exact problem, but for some reason it seems to only happen the *second* time I invoke ClosedXML in my particular software. For whatever reason, the first time I process a file through it, the conditional formatting is all preserved. Just the second (and further) times, the conditional formatting sequence gets all out of whack. Because it works right the first time and not subsequent, it feels like some kind of memory leak issue or something. I dunno. I am continuing to try memory cleanup operations in the hopes that can provide some kind of workaround. The issue seems to happen regardless if I stuff any data into the source file or not. Simply instantiating the workbook and immediately saving it is enough to butcher up the conditional formatting. I'm using the latest ClosedXML from 9/2014.
This is crutial because it alters the order and stop-if-true states of the conditional formats in the excel spreadsheet (.xlsx file).
To duplicate the issue. Use MS excel and do the following:
1. Create a xlsx file with many sets of conditional formats, each set doing a format change on a specific range of cells.
2. Set the "Stop if true" property to true, by checking the checkbox. Save this xlsx file.
3. Use "ClosedXML.Excel.XLWorkbook" to load the saved xlsx file; use a variable to load the workbook object (say var wb = ...).
4. Save the workbook as a new workbook, using wb.SaveAs();
5. Open the saved workbook and check the conditional formats. The order is all changed and stop if true is not checked!!
Comments: I seem to be having this exact problem, but for some reason it seems to only happen the *second* time I invoke ClosedXML in my particular software. For whatever reason, the first time I process a file through it, the conditional formatting is all preserved. Just the second (and further) times, the conditional formatting sequence gets all out of whack. Because it works right the first time and not subsequent, it feels like some kind of memory leak issue or something. I dunno. I am continuing to try memory cleanup operations in the hopes that can provide some kind of workaround. The issue seems to happen regardless if I stuff any data into the source file or not. Simply instantiating the workbook and immediately saving it is enough to butcher up the conditional formatting. I'm using the latest ClosedXML from 9/2014.