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

How to add text with a newline in it?

Thread ID:





53805 Dec 20,2006 04:33 PM UTC Dec 21,2006 10:54 AM UTC WinForms 1
Tags: XlsIO
Daniel Chait
Asked On December 20, 2006 04:33 PM UTC

If I set text in an excel workbook that has a newline in it, the resulting workbook just shows a square where the \n was in the source text.

I am using

string myStr = "hello\nthere";
IRange.Text = myStr;

How can I make this work?

Melba Winshia [Syncfusion]
Replied On December 21, 2006 10:54 AM UTC

Hi Daniel,

Could you Please try using \n inserted at the place where you need the line break and set the WrapText property to true.


// New Line
sheet.Range["A1"].Text = "Hello\nWorld";
sheet.Range["A1"].CellStyle.WrapText= true;

Here is the sample for your reference:

Please take a look at the sample above and let me know if you have any other questions.

Best Regards,


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