in reply to Re: How to set an Excel column to 'AutoFit'
in thread How to set an Excel column to 'AutoFit'

Thanks guys...I was affraid of that but it doesn't make sense. If I can alter data for the cell at runtime, seems like I could alter the cell width as well. Thanks for the quick response nevertheless.
  • Comment on Re^2: How to set an Excel column to 'AutoFit'

Replies are listed 'Best First'.
Re^3: How to set an Excel column to 'AutoFit'
by davorg (Chancellor) on Jul 21, 2006 at 15:15 UTC

    Jim,

    You may have misread the documentation. The "set_column" method does allow you to alter the cell width. But you have to give it a "real" width; you can't just ask for the "best fit" width (which is what AutoFit does).

    I see that John has posted a link to a workaround that allows you to calculate a width that is approximately what AutoFit would give you.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg