We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to Automatically wrap cell content without width or height using aspose.cell using dotnet

Hi Team,
I need to wrap the text in a cell automatically? is there a way do it in aspose.cells.
As we do in excel directly


See the document with example code for your reference:

Hope, this helps a bit.

Thanks for the quick response, but in the example you have shared it has fixed width and height then only wrapping happens, but what if the text/context goes beyond the fixed width/height provided.



Please call auto-fit row to wrap text automatically in the cell. See the following sample line of code:
Sample code:

//Autofit first row


Also, please note, you should at least first set the column’s with (if you do not want to set the row height in code) because if you do not specify the column’s width, it will use existing width of the column in the worksheet (which is just 8.43 units (64 pixels) normally).