in reply to Re^14: protect excel file in perl script
in thread protect excel file in perl script
Try without worksheets method which was added in version 0.43 January 7 2009
#!/usr/bin/perl -w use strict; use Spreadsheet::ParseExcel; my $file = '/home/muthum/excel1.xls'; my $parser = Spreadsheet::ParseExcel->new( Password => 'secret' ); my $workbook = $parser->Parse($file); if ( !defined $workbook ) { die $parser->error(), ".\n"; } my $count = $workbook->{SheetCount}; print "Workbook has $count sheets\n"; for my $i (0..$count-1){ my $worksheet = $workbook->{Worksheet}[$i]; my $cell = $worksheet->get_cell( 0, 0 ); if ($cell){ print "[A1] = '", $cell->Value,"'\n"; } }
What are you trying to do with the spreadsheet, just read the contents ?
poj
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^16: protect excel file in perl script
by arunks (Novice) on Mar 22, 2017 at 12:00 UTC | |
by marto (Cardinal) on Mar 22, 2017 at 12:11 UTC | |
by poj (Abbot) on Mar 22, 2017 at 12:57 UTC | |
by arunks (Novice) on Mar 22, 2017 at 13:12 UTC | |
by poj (Abbot) on Mar 22, 2017 at 13:47 UTC | |
by arunks (Novice) on Mar 22, 2017 at 14:02 UTC |