I have generated the excel sheet using set of csv files using perl script.In that i need to set width of the column as auto-fit.What \'m suppose to do i\'ve got
There is no way to set a file's column to "AutoFit" because that is not a setting of the file. Excel calculates this and sets a column width at run-time.
One option is to calculate the "AutoFit" width yourself based on your data, and then set the column width to the value that you calculate. This discussion gives some workaround code that does that.
Another option is to use Win32::OLE to set the column to AutoFit. How to do this is not documented in the module itself; you would have to search around the Microsoft OLE documentation to find the appropriate command.
Update: This site appears to show how to use AutoFit with Win32::OLE
.
Have a look at the autofit.pl example here
You could generate your Excel file with Excel::Writer::XLSX module, and adjust the column width with set_column method