InsertRow throws an error when worksheet has conditional formatting

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

3 Replies

AV Abirami Varadharajan Syncfusion Team June 6, 2018 11:02 AM UTC

Hi Nicholas, 

Thank you for contacting Syncfusion support.  

We are able to reproduce issue with “Exception raised while inserting row to Excel worksheet having conditional format applied to entire column” in our previous release assemblies. However, we have fixed and included it in our release version 15.4.0.17 which was rolled out by November 2017.  So, we request you to upgrade to our latest release version 16.1.0.37 to resolve the issue at your end. This includes more bug fixes, features and enhancements which is available for download under following link.  

Download Link:     

Please let us know if you have any concerns. 

Regards,  
Abirami  



NP Nicholas Paradiso June 6, 2018 06:12 PM UTC

Upgraded to the new version and the problem is gone.  Thank you for the help!


AV Abirami Varadharajan Syncfusion Team June 7, 2018 12:17 PM UTC

Hi Nicholas, 
 
Thank you for contacting Syncfusion support. 

We are glad that your issue is resolved. Please get back to us if you need further assistance. 

Regards, 
Abirami 


Loader.
Up arrow icon