Use AutoFitColumns , but you must specify the cells, I accept the whole worksheet:
Vb.net
Worksheet.Cells(Worksheet.Dimension.Address).AutoFitColumns()
FROM#
Worksheet.Cells[Worksheet.Dimension.Address].AutoFitColumns();
Please note that you need to call this method after filling out the worksheet.
Tim Schmelter Mar 26 '13 at 17:00 2013-03-26 17:00
source share