Auto Fit Column


#1

I can not figure out why autoFitColumn does not work on my template. Please help. I am using the latest 3.5.0.3

Dim excel As Aspose.Excel.Excel

excel = New Aspose.Excel.Excel

excel.Open("C:\sample.xls")

Dim w As Aspose.Excel.Worksheet = excel.Worksheets(0)

For i As Int32 = 1 To 50

w.AutoFitColumn(i, 4, 30)

Next

excel.Save("c:\ee1.xls")

System.Diagnostics.Process.Start("c:\ee1.xls")


#2

Row 7, which is the data header does not get auto fit.


#3

In row 7, all cells are set as wrap text. AutoFitColumn method will not take effect on these cells. It’s same as MS Excel. To make it work, please uncheck “wrap text” option in formatting.