How to autofit column width using Excel::Writer::XLSX

15,583

Have a look at this example => https://metacpan.org/pod/Spreadsheet::WriteExcel::Examples#Example:-autofit.pl

Share:
15,583
John Jiang
Author by

John Jiang

Updated on June 19, 2022

Comments

  • John Jiang
    John Jiang almost 2 years

    I am using Excel::Writer::XLSX module to generate excel report, but I can not find the method about 'autofit', now the column width must be set in advance. So I'd like to know how to autofit the column width in sheet using Excel::Writer::XLSX module. Thanks.

  • jmcnamara
    jmcnamara over 10 years
    This is the correct answer. Autofit isn't part of the Excel file format so it can't be done automatically by Excel::Writer::XLSX. However, with a small bit of work it can be simulated by the technique shown in the linked example.