in reply to Modifying xlsx file with perl

G'day sogo87,

Welcome to the monastery.

Spreadsheet::XLSX is for reading only.

Excel::Writer::XLSX is for writing; however, it can only write to newly created files. The fourth line of the DESCRIPTION says:

"This module cannot, as yet, be used to write to an existing Excel XLSX file."

So, what you'll probably need to do is read the existing file, create a new file, then write the original data along with any modifications or additions. The basic code would look something like:

for my $read_sheet ... for my $row ... for my $col ... my $cell = $read_sheet->{Cells}[$row][$col]; $write_sheet->write($row, $col, $cell->{Val}); ... ... ...

-- Ken