Hi, Adjustment should be about 1.1-1.3, not 100 which is too big. Adjustment fixed should be normally 0 and probably there is no need to set a min and max width. Also, probably you don't want to ignore the strings.

If you try with: xlso.AutofitCol(1, xls.ColCount, 10, 500, false, 1.2, 0, 0, 0, TAutofitMerged.None);

Hi, the first parameter after the "False" is the adjustment, and that is a value that will be multiplied by the width to give some margin to the cells. So say for example FlexCel calculates the needed width of the column to be 5, if autofit is 1.1, then it will fit the column to 5 * 1.1 = 5.5, so the column will be wider to that the exact minimum, and will work when Excel changes resolutions.

In an ideal world you would multiply by 1, in reality you need to multiply by 1.1 or 1.2. But if you multiply by 0, then no autofitting will happen because FlexCel will think all columns are of width 0, so they fit without any column change.

Just a note: Maybe you were confused about "Adjustment" and "Adjustment fixed". As said in the previous post, adjustment is a number you multiply to the final result. On the other hand, adjustmentFixed is a number you add to the final result.

The formula is:

Final width of the column = Calculated_width * adjustment + adjustment_fixed.

So the "natural" values for the final column to be the calculated width would be:

adjustment = 1

adjustment_fixed = 0.

In reality, you normally keep adjustment_fixed 0, but set adjustment to about 1.2 to compensate for what Excel shows at different dpis.