Leser: 12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/perl
use warnings;
use strict;
use Spreadsheet::WriteExcel;
use Spreadsheet::ParseExcel::SaveParser;
#Originaldatei sichern
rename('test.xls', 'test.xls.bak')
|| die "Umbenennung nicht möglich!";
unlink('test.xls');
# Open the template with SaveParser
my $parser = new Spreadsheet::ParseExcel::SaveParser;
my $template = $parser->Parse('test.xls.bak');
my $sheet = 0;
my $row = 0;
my $col = 0;
$sheet = $template->{Worksheet}[0];
$row = $sheet->{MaxRow};
$sheet = 0;
# Get the format from the cell
my $format = $template->{Worksheet}[$sheet]
->{Cells}[$row][$col]
->{FormatNo};
# Write data to some cells
$template->AddCell(0, $row+1, $col, 1, $format);
$template->AddCell(0, $row+2, $col, "Hello", $format);
my $workbook = $template->SaveAs('test.xls');
system("\"C:\\Programme\\Microsoft Office\\Office\\EXCEL.EXE\" \"U:\\Eclipse\\workspace\\Excel_schreiben\\test.xls\"");
1;