Thanks for providing us further details and PDF file containing the screenshots.
To test your scenario/case, I simply created a template Excel file (attached). In A1 cell of the first worksheet, I enter the value, i.e., “Center aligned cells” in such a way that I clicked “Alt + Enter” after inserting “Center” word, this would create two lines (with wrapped text option on) and the rest of the text, i.e., “aligned cells” would be placed in the second line. Now I used different versions, e.g v5.3.x, 8.3.x and latest version, i.e., Aspose.Cells for .NET v17.9. I noticed and confirmed your mentioned behavior (i.e., for a hard return, the Cell.StringValue has \r\n for older versions but \n in newer) after loading the file into Aspose.Cells object model using the following code and checking the properties of the Cell object in debug mode in
VS.NET. I am not sure if this is an issue with our newer version(s) or expected/correct behavior regarding hard returns. This change was introduced later on in newer versions though. Either this was a bug in older versions and was corrected later on or there might be something else which incorporated this behavior.
var workbook = new Workbook("e:\\test2\\Bk_msexcelhardreturn1.xlsx");
var worksheet = workbook.Worksheets;
var cell = worksheet.Cells["A1"];
I need to discuss with product team and we will get back to you soon with more details.
file1.zip (9.7 KB)