Hi,
When I used Workbook.Save(), thrown exception:
Hi,
When I used Workbook.Save(), thrown exception:
Hi,
don't work.
the problem is xls version.
When I save with xlsx format, it's work.
See sample project.
Thank you.
Hi,
Thanks for your posting and using Aspose.Cells for .NET
I was able to replicate the problem with the latest version:
Aspose.Cells
for .NET v7.2.0.6 using the code given below.
We have logged this issue in our database. Development team will look into this issue, once the issue is resolved or we have some other update for you relating to this issue, we will let you know asap.
This issue has been logged as CELLSNET-40667.
I have attached the screenshot for a reference.
C#
Hi,
It’s the limitation of xls file that there are too much ranges in one conditional formatting.
Could you please show us how to create such file?
Hi,
CellArea cellAreaRow = new CellArea();
cellAreaRow.StartColumn = tb.StartColumnIndex;
cellAreaRow.StartRow = this.StartRowIndex;
cellAreaRow.EndColumn = tb.EndColumnIndex;
cellAreaRow.EndRow = this.EndRowIndex;
int ixConditionalCollection = wb.Worksheets[tb.WorksheetIndex].ConditionalFormattings.Add();
FormatConditionCollection fcs = wb.Worksheets[tb.WorksheetIndex].ConditionalFormattings[ixConditionalCollection];
fcs.AddArea(cellAreaRow);
int ixConditional = fcs.AddCondition(FormatConditionType.Expression);
FormatCondition fc = fcs[ixConditional];
fc.Formula1 = "=MOD(ROW(),2)";
fc.Style.BackgroundColor = Color.Gainsboro;
Hi,
Thanks for your sample code.
I was not able to reproduce the problem using your code. In order to run your code, I have to modify it a little because it had built errors.
Could you please provide a code that could be run and replicate the problem?
Please see the code below. I am attaching output.xlsx and output.xls file.
First your code is run and it creates output.xlsx file, then next code loads the output.xlsx file and saves it as output.xls file which should throw exception but it is not throwing any exception.
I have used the latest version:
Aspose.Cells
for .NET v7.2.0.7
Please download and try it.
C#
This issue occurs because was generating xls with many columns.
I changed the copy method (Cell.CopyRows to Range.Copy) and worked.
See CELLSNET-40666.
Thank you.
Hi,
It’s good to know that your issue is resolved now because of Range.Copy() method.
Range.Copy() method is very useful in combining the multiple worksheets into a single worksheet, therefore, I have also added an article relating to it inside documentation.
Combine Multiple Worksheets into a Single Worksheet
The issues you have found earlier (filed as CELLSNET-40667) have been fixed in this update.