How can I modify an existing Excel workbook with Perl?

后端 未结 4 1709
盖世英雄少女心
盖世英雄少女心 2021-01-02 12:04

With Spreadsheet::WriteExcel, I can create a new workbook, but what if I want to open an existing book and modify certain columns? How would I accomplish that?

I cou

4条回答
  •  感情败类
    2021-01-02 12:46

    Spreadsheet::ParseExcel will read in existing excel files:

    my $parser   = Spreadsheet::ParseExcel->new();
    # $workbook is a Spreadsheet::ParseExcel::Workbook object
    my $workbook = $parser->Parse('Book1.xls');
    

    But what you really want is Spreadsheet::ParseExcel::SaveParser, which is a combination of Spreadsheet::ParseExcel and Spreadsheet::WriteExcel. There is an example near the bottom of the documentation.

提交回复
热议问题