Free Support Forum - aspose.com

Autofit all rows

I would like to autofit all rows in a worksheet. I have the newest version of Aspose Cells installed 4.1.0.0.

This is the code I was hoping would work but no such luck.

Dim sheetRow As Aspose.Cells.Row

For Each sheetRow In workbook.Worksheets(0).Cells.Rows

Dim rowIndex As Integer = sheetRow.Index

sheet.AutoFitRow(rowIndex, 0, 255)

Next

Thanks for your help,

Tyler

Please try the following code to autofit all rows in a worksheet.

sheet.AutoFitRows()