We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Add break line in an Excel Cell

Thread ID:





74165 Jun 2,2008 02:59 PM UTC Jun 4,2008 05:38 AM UTC ASP.NET Web Forms (Classic) 1
Tags: XlsIO
Pierre-Alain Galtier
Asked On June 2, 2008 02:59 PM UTC


I would like to have a line break inside a cell.

I tried \n and it works when opening whis OpenOffice but not when opening with Excel 2007.

Have you got a solution for me ?

Thanks a lot

Dhivya K [Syncfusion]
Replied On June 4, 2008 05:38 AM UTC

Hi Christophe,

Thank you for your interest in Essential XlsIO.

I am able to reproduce the issue. To make line break work for Excel 2007, please set the text wrap for the cell and then break the text as follows:

sheet.Range["A1"].CellStyle.WrapText = true;
sheet.Range["A1"].Text = String.Format("Hello\nworld");

Please let me know if this helps.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon