Free Support Forum -

Multiple lines in html is not considered in excel

I am generating a workbook from HTML. The content of a “td” tag is multi-line text. But while exported as a worksheet the content is shown as a single line text. Can you please suggest me what can be done to display its as a multi-line text.

I have attached the snip of my code, the HTML used to create it and the excel (76.7 KB)

var loadOptions = new HTMLLoadOptions(LoadFormat.Html)
AutoFitColsAndRows = true
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(htmlData)))
Workbook wb = new Workbook(stream, loadOptions);
using (var documentStream = new MemoryStream())
wb.Save(documentStream, SaveFormat.Xlsx);

Amith Antony


We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-46241 - Problem with multi-line text in HTML


Please try our latest version/fix: Aspose.Cells for .NET v18.7.5:

Your issue should be fixed in it.

Let us know your feedback.

Please use the following code to test it:
Sample code:

HTMLLoadOptions options  = new HTMLLoadOptions();
options.AutoFitColsAndRows = true;
Workbook wb = new Workbook(filePath + "Multi-line.html", options);
wb.Save(filePath + "out.xlsx");

Thanks for the update. The fix works for me.


Good to know that your issue is sorted out by the new fix/version. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

The issues you have found earlier (filed as CELLSNET-46241) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi