Leser: 2
3 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
my $oldworkbook;
if(-e $filename) {
$oldworkbook = Spreadsheet::ParseExcel::Workbook->Parse($filename);
}
my $workbook = Spreadsheet::WriteExcel->new($filename);
if(defined $oldworkbook) {
for(my $i = 0; $i < $oldworkbook->{SheetCount}; $i++) {
my $ws = $oldworkbook->{Worksheet}[$i];
my $worksheet = $workbook->add_worksheet($ws->{Name});
for(my $row = $ws->{MinRow}; defined $ws->{MaxRow} && $row <= $ws->{MaxRow}; $row++) {
for(my $col = $ws->{MinCol}; defined $ws->{MaxCol} && $col <= $ws->{MaxCol}; $col++) {
my $cell = $ws->{Cells}[$row][$col];
$worksheet->write($row, $col, $cell->Value);
}
}
}
}
3 Einträge, 1 Seite |