Subject: | {MinCol} fails for some spreadsheets with null A1 |
I think the following is failing for the attached spreadsheet:
my $excel = Spreadsheet::XLSX -> new ('test.xlsx');
If you execute a script that prints the values of the first two columns
for all rows it will not print any column A value for the attached
spreadsheet (a sample of many that also fails). If you change A1 to
space, delete the space, then save (or use Excel to save to another
file) everything is fine. See test script below:
++++++++++++++++++++++++++++++++++++++++++++
my $excel = Spreadsheet::XLSX -> new ('test.xlsx'); # this line could
be failing if the creation determines {MinCol}
foreach my $sheet (@{$excel -> {Worksheet}}) {
printf("Sheet: %s\n", $sheet->{Name});
$sheet -> {MaxRow} ||= $sheet -> {MinRow};
foreach my $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) {
$sheet -> {MaxCol} ||= 0;
foreach my $col ($sheet -> {MinCol} .. $sheet -> {MaxCol}) {
my $cell = $sheet -> {Cells} [$row] [$col]; # this returns
a null value for all rows before saving the spreadsheet
if ($cell) {
printf("( %s , %s ) => %s\n", $row, $col, $cell -> {Val});
} else {
printf("( %s , %s ) => %s\n", $row, $col);
}
}
}
Subject: | test.xlsx |
Message body not shown because it is not plain text.