From 2734293556482250c43add75ec9fb53e751ee438 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 26 Jul 2013 03:28:47 -0400 Subject: some xlsx generators don't set the 'selection' node (fixes #1) --- lib/Spreadsheet/ParseXLSX.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Spreadsheet/ParseXLSX.pm b/lib/Spreadsheet/ParseXLSX.pm index 410a45d..d96d275 100644 --- a/lib/Spreadsheet/ParseXLSX.pm +++ b/lib/Spreadsheet/ParseXLSX.pm @@ -214,9 +214,13 @@ sub _parse_sheet { ]; my ($selection) = $sheet_xml->find_nodes('//selection'); - my $cell = $selection->att('activeCell'); - - $sheet->{Selection} = [ $self->_cell_to_row_col($cell) ]; + if ($selection) { + my $cell = $selection->att('activeCell'); + $sheet->{Selection} = [ $self->_cell_to_row_col($cell) ]; + } + else { + $sheet->{Selection} = [ 0, 0 ]; + } } sub _parse_shared_strings { -- cgit v1.2.3-54-g00ecf