AutoFitRow


#1

Hello,

I am having a problem with the AutoFitRow() method. When I open the created Excel file, the rows are not auto-fit. I am using version 2.4.0.0. Here is my code:

Dim i, j As Integer

For i = 0 To x

ws.AutoFitRow(i)

For j = 0 To CELL_COUNT

ws.Cells(i, j).Style.IsTextWrapped = True

Next

Next

Please advice, Thanks!
C.


#2

Hi,

Please set IsTextWrapped to true before you call AutoFitRow method.

Dim i, j As Integer

For i = 0 To x

For j = 0 To CELL_COUNT

ws.Cells(i, j).Style.IsTextWrapped = True

Next

ws.AutoFitRow(i)


Next