Search code examples
c#excelopenxmlmeasurestring

Get height of row where the cells have WrapText set


I am trying to compute the height of the row I'm inserting into my excel sheet. The row's cells are formatted with WrapText=true, so the height of the row is not fixed. Accessing row.Height will return null.

I was thinking of using something similar to Graphics.MeasureString where I also specify the width constraint in order to retrieve the height.

Didn't find any relevant info online. Any help would be appreciated.


Solution

  • See my post here using Graphics.MeasureString. It works very well.

    Autofit Row Height of Merged Cell in EPPlus