OK gurus - I need to read in a previously generated spreadsheet - and then add new data from a db -
I have this so far -
for(my $iSheet=0; $iSheet < $oBook->{SheetCount} ; $iSheet++) {
$oWkS = $oBook->{Worksheet}[$iSheet];
for(my $iR = $oWkS->{MinRow} ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++){
$iR = $oWkS->{MaxRow};
$iR++;
my $date = "28/08/2004";
my $name = "Joe Bloggs";
my $contact = "0845 055 0505";
#1.1.Update and Insert Cells
my $iFmt = $oBook->{Worksheet}[$iSheet]->{Cells}[0][0]->{FormatNo};
$oBook->AddCell(0, $iR , 0, $date, $oBook->{Worksheet}[0]->{Cells}[0][0]->{FormatNo});
$oBook->AddCell(0, $iR, 0, $name, $oBook->{Worksheet}[0]->{Cells}[0][0]);
$oBook->AddCell(0, $iR, 1, $contact,$oBook->{Worksheet}[0]->{Cells}[0][0]);
# $oBook->AddCell(0, $iR, 1, $contact , $iFmt);
}
}
This work ok - it puts in the variables in the correct cells but only on the first workbook -
There are 12 - what am I missing ?
cheers in advance
Rab
I have this so far -
for(my $iSheet=0; $iSheet < $oBook->{SheetCount} ; $iSheet++) {
$oWkS = $oBook->{Worksheet}[$iSheet];
for(my $iR = $oWkS->{MinRow} ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++){
$iR = $oWkS->{MaxRow};
$iR++;
my $date = "28/08/2004";
my $name = "Joe Bloggs";
my $contact = "0845 055 0505";
#1.1.Update and Insert Cells
my $iFmt = $oBook->{Worksheet}[$iSheet]->{Cells}[0][0]->{FormatNo};
$oBook->AddCell(0, $iR , 0, $date, $oBook->{Worksheet}[0]->{Cells}[0][0]->{FormatNo});
$oBook->AddCell(0, $iR, 0, $name, $oBook->{Worksheet}[0]->{Cells}[0][0]);
$oBook->AddCell(0, $iR, 1, $contact,$oBook->{Worksheet}[0]->{Cells}[0][0]);
# $oBook->AddCell(0, $iR, 1, $contact , $iFmt);
}
}
This work ok - it puts in the variables in the correct cells but only on the first workbook -
There are 12 - what am I missing ?
cheers in advance
Rab