How to make columns to be auto width when texts in columns are long?
I use this code
Worksheet.Column(colIndex).AutoFitColumn() \'on all columns\'
It's working just fine for me.
Try:
ExcelWorksheet wsSheet1 = ExcelPkg.Workbook.Worksheets.Add("Sheet1"); wsSheet1.Cells[wsSheet1.Dimension.Address].AutoFitColumns(); ExcelPkg.SaveAs();