Missing char(13) after saving

Hi,

please check following code.


xlsLic.SetLicense(“Aspose.Total.lic”);

Workbook wb = new Workbook(“Example vbCrLF and vbCR.xlsx”);
string newvalue = “Current month /\r\nquarter prior year”;

wb.Worksheets[0].Cells[“A2”].PutValue(newvalue);

wb.Save(“Example vbCrLF and vbCR new.xlsx”);
Workbook wbNew = new Workbook(“Example vbCrLF and vbCR new.xlsx”);
string resultA2new = wbNew.Worksheets[0].Cells[“A2”].StringValue;




If you look to workbook ‘Example vbCrLF and vbCR new’
the chr(13) is missing AFTER saving.

Kind regards,

Guido

Hi Guido,


Thank you for contacting Aspose support.

Please try the same scenario in Microsoft Excel application by inserting the string =“Current month /”&CHAR(13)&CHAR(10)&“quarter prior year” in any cell. You will notice that the result of Excel application matches with the result generated with latest version of Aspose.Cells for .NET 8.5.2.3. I have attached my test spreadsheet here for your reference.

Hi,


Please try our latest version/fix: Aspose.Cells for .NET v8.5.3.3 (attached).

I have tested your code segment with it, it works fine and I do not find the issue you mentioned for the A2 cell. The cell is updated with your updated value fine.

Let us know if you still find the issue.

Thank you.

Hi,

that is strange.

I use 8.5.3.3 already.

I still have the issue with my workbook (attached above).
But not with your workbook.

Can you test it with my workbook ?

Kind regards,
Guido

and you add a formula:

=“Current month /”&CHAR(13)&CHAR(10)&"quarter prior year"

but we use simply text

Current month /
quarter prior year

That looks equal but it is not the same.

Hi,

Thanks for your posting and using Aspose.Cells.

I have tested your issue with the sample code given by you in the first post with your source excel file which you have attached in the first post and did not find the issue. I used the latest version: Aspose.Cells
for .NET v8.5.2.2
.

Both strings are same.and ret is true which means both are same.

C#
Workbook wb = new Workbook(“Example vbCrLF and vbCR.xlsx”);
string newvalue = “Current month /\r\nquarter prior year”;

wb.Worksheets[0].Cells[“A2”].PutValue(newvalue);

wb.Save(“Example vbCrLF and vbCR new.xlsx”);
Workbook wbNew = new Workbook(“Example vbCrLF and vbCR new.xlsx”);
string resultA2new = wbNew.Worksheets[0].Cells[“A2”].StringValue;

//True means both are same
bool ret = newvalue == resultA2new;