Auto column width in EPPlus
Asked 07 September, 2021
Viewed 1.5K times
  • 56
Votes

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'
 Worksheet.cells.AutoFitColumns()
 Worksheet.Column(colIndex).BestFit = True  'on all columns'

None of these methods are working

Are there any ways to make it work?

Note: Some of my texts use Unicode.

10 Answer