Free Support Forum - aspose.com

Aspose.Cells is putting #N/A in subsequent row of same columns if previous one contains same data

Aspose.Cells.Workbook ExcelApp = new Workbook();

Aspose.Cells.Worksheet wrkSheet = ExcelApp.Worksheets[0];

//Accessing the "A1" cell from the worksheet

Cell cell = wrkSheet.Cells["A1"];

//Adding some value to the "A1" cell

cell.PutValue("VisitAspose!");

cell.Style.IsTextWrapped = true;

//Setting the font of selected characters to bold

cell.Characters(6,7).Font.IsBold=true;

//Setting the font color of selected characters to blue

cell.Characters(6,7).Font.Color=Color.Blue;

//Accessing the "A2" cell from the worksheet

cell = wrkSheet.Cells["A2"];

cell.Copy(cell);

//Adding some value to the "A1" cell

cell.PutValue("VisitAspose123!");

cell.Style.IsTextWrapped = true;

//Setting the font of selected characters to bold

cell.Characters(6,7).Font.IsBold=true;

//Setting the font color of selected characters to blue

cell.Characters(6,7).Font.Color=Color.Blue;

//Saving the Excel file

ExcelApp.Save("C:\\TC.xls",FileFormatType.Default);

Output of Cell:

A

1 VisitAspose!

2. #N/A

Please try this attached fix. It's solved.

By the way, I think your sample test code also need to be changed for a little:

Cell cell2 = wrkSheet.Cells["A2"];

cell2.Copy(cell);

Thanks for your prompt reply.

My only concern is our organization is going to buy Aspose.Cells please let me know that will this fix get reflected there as well.

Thanks

Ankur Mittal

Thank you for purchasing Aspose.Cells.

You can use this fix. And a public version including this fix will be released in the start of next month.