in reply to How to set an Excel column to 'AutoFit'

Hi JimRobinson,

From the Spreadsheet::WriteExcel documentation, under set_column method:

'The width corresponds to the column width value that is specified in Excel. It is approximately equal to the length of a string in the default font of Arial 10. Unfortunately, there is no way to specify "AutoFit" for a column in the Excel file format. This feature is only available at runtime from within Excel.'

I guess your best bet is to drive Excel to do this via Win32::OLE.

Hope this helps.

Martin