use Win32::OLE::Variant; ... (my $ls = $hashref->{'Last Saved'}) =~ s/^(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)$/$1 $2 $3 $4:$5:$6/; if ($ls ne "") { my $var = Variant(VT_DATE, $ls); $worksheet->Cells($row, $col++)->{'Value'} = $var; } else { $worksheet->Cells($row, $col++)->{'Value'} = '-'; }