This project has moved. For the latest updates, please go here.

Wrap text in formula cell

Nov 12, 2012 at 12:10 PM
Edited Nov 12, 2012 at 12:11 PM


I couldn't replicate the following excel behaviour:

in a cell reference other cell with a long string, then set wrap text. the cell row adapts accordingly.

            var generated = new XLWorkbook();
            var workSheet = generated.AddWorksheet("Test");
            workSheet.Cell("B1").Style.Alignment.WrapText = true;
            workSheet.Cell("B1").Value = "hello hello hello hello hello";
            workSheet.Cell("A3").FormulaA1 = "B1";
            workSheet.Cell("A3").Style.Alignment.WrapText = true;

I also tried

but with no success...


Nov 14, 2012 at 4:44 PM

This one took a while to figure out.

Excel is actually cheating when you set the wrap text on a cell that points to another. It calculates the required height and then sets row height property. This is something I can't do here.

You'll have to do without.