I am inputting values into a spreadsheet using Apache POI. These values have newlines, and I was able to use this code successfully:
CellStyle style = cell.g
currentRow.setHeight((short)-1)
Works for XSSFCell and Excel 2013