EPPlus namedstyle horizontalAlignment

I have a problem implementing the following code:

var newNamedStyle=_workbook.Styles.CreateNamedStyle("testStyle"); newNamedStyle.Style.HorizontalAlignment=ExcelHorizontalAlignment.Center; newNamedStyle.Style.Font.Size=15; 

but EPPlus doesn't seem to be able to fix horizontal alignment correctly.

Could this be a mistake with EPPlus?

Any work for this?

+4
source share
1 answer

I managed to center the cell horizontally using EPPlus (3.1.3) like this.

  xlWorkSheet.Cells["A1"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center; 
+8
source

All Articles