Actually Fmt2007.pm needs fixing too, here is a more comprehensive patch:
--- lib/Spreadsheet/XLSX/Fmt2007.pm 2010-05-16 10:07:42.000000000 +0100
+++ lib/Spreadsheet/XLSX/Fmt2007.pm 2012-08-16 12:10:44.586385956 +0100
@@ -93,7 +93,9 @@
if ($oCell->{Type} eq 'Numeric') {
if($oCell->{Format}){
$sFmtStr=$oCell->{Format};
- } elsif(int($oCell->{Val}) != $oCell->{Val}) {
+ } elsif($oCell->{Val} eq "#N/A" or $oCell->{Val} eq "#VALUE!") {
+ $sFmtStr = '0';
+ } elsif(int($oCell->{Val}) != $oCell->{Val}) {
$sFmtStr = '0.00';
}
else {
--- lib/Spreadsheet/XLSX.pm 2012-08-16 12:02:49.047772667 +0100
+++ lib/Spreadsheet/XLSX.pm 2012-08-16 12:02:24.778332419 +0100
@@ -210,7 +210,7 @@
);
$cell->{_Value} = $oBook->{FmtClass}->ValFmt($cell, $oBook);
- if ($type eq "Date" && $v<1){ #then this is Excel time field
+ if ($type eq "Date" && $v ne "#N/A" && $v<1){ #then this is
Excel time field
$cell->{Type}="Text";
$cell->{Val}=$cell->{_Value};
}