I have the following code:
- Code: Select all
double RowHeightBefore = Sheet.Range["C22"].RowHeight;
Sheet.Range["C22"].Style.WrapText = true;
Sheet.Range["C22"].Value = "Text which is wider than the cell so needs to be wrapped.";
double RowHeightAfter = Sheet.Range["C22"].RowHeight;
However, RowHeightBefore and RowHeightAfter are still showing as being the same even though the row height has been increased. (I can see it when I open the file in Excel.)
How can I get the new row height after the text wrapping has increased the height?
Are there any other ways to check if setting the value of a cell will cause the text to be wrapped?
Thanks