Page 1 of 1

Bestfit

Posted: Tue Mar 02, 2010 11:32 am
by antonb
Hi,

I am trying to use the BestFit column property, but i can't see that it does anything? What is it supposed to do?

Anton Bosch

Re: Bestfit

Posted: Tue Mar 02, 2010 12:47 pm
by larsa
Hello

The BestFit property is used by Excel 2007 files. I have never tested it, so I can't tell if it works.
If you want to size a column to the text width, use:

XLS.Sheets[x].Columns.AddIfNone(Col1,Col2 - Col1 + 1);
XLS.Sheets[x].AutoWidthCol(Col1,Col2);