TimAttaway
asked on
Workaround for Excel not Wrapping Text in Merged Cells
I am creating a spreadsheet using Open Office XML. The spreadsheet contains merged cells that contain text. In many cases, the text is longer than the size of the merged cells so it needs to wrap. I have the cell style set to wrap, but Excel ignores it. From searching on the internet, it seems that Excel ignoring "wrap' on merged cells is a long standing problem. The only workarounds that I see offered are to manually resize the rows, which would not be a problem if I were creating the spreadsheet manually.
Does anybody know a way to programmatically assess the size of a text string to figure out what the height of the row needs to be? Given a string, a font, a font size, font characteristics (bold, italics, whatever), and the width of the cell (in points or pixels), how can I compute what the height of row containing the cell needs to be so that I can see the entire string?
Thanks.
Does anybody know a way to programmatically assess the size of a text string to figure out what the height of the row needs to be? Given a string, a font, a font size, font characteristics (bold, italics, whatever), and the width of the cell (in points or pixels), how can I compute what the height of row containing the cell needs to be so that I can see the entire string?
Thanks.
Check this file for column Size
size.xlsm
size.xlsm
This one showing according to font
size.xlsm
size.xlsm
ASKER
Thanks, but this does not really have anything to do with the question that I asked. I need something that can run on a server creating the sheet using open office xml, not a macro that runs inside the spreadsheet.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I solved this issue myself. I am posting the results in case they may be useful to someone else.
ASKER