Hello,
I am using an old version of syncfusion (14.3450.0.49).
Using XlsIO I am opening a excel file and trying to run the command InsertRow(2) (the code is below). However when the excel file that I am opening has conditional formatting set I get the error
Specified argument was out of the range of valid values.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Is there a way to insert a row into an excel file that has conditional formatting? If not, how do I move the all conditional formatting from the worksheet? I tried worksheet.UsedRange.Clear(ExcelClearOptions.ClearConditionalFormats); but it only removes the conditional formatting from the used range and in my example the conditional formatting is set on the entire column.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
IWorkbook workbook = application.Workbooks.Open(filePathAndName);
IWorksheet sheet = workbook.Worksheets[0];
workbook.Version = ExcelVersion.Excel2016;
sheet.InsertRow(2);
Attachment:
Conditional_Format_TEST_bca5317b.zip