OpenOffice Spreadsheet

G

Grehom

I'm just trying to read a column in a spreadsheet and create a new
value in a new column to right of the others.
I tried with the following, but it doesn't create the new column, any
hints please

use OpenOffice::OODoc;
my $doc = odfDocument(file => 'iwm.ods');

$row = 3;
while ( my $cli = $doc->cellValue(0, "D$row") ) {
my $username = get_customer_account( $dbh, $cli );
print "$cli => $username\n";
$doc->cellValue(0, "E$row", $username);
$row++;
}

$doc->save();


It's reading the spreadsheet fine, but it's not inserting the new
value into 'E' column
 
C

Chris Haffenstedt

Grehom said:
I'm just trying to read a column in a spreadsheet and create a new
value in a new column to right of the others.
I tried with the following, but it doesn't create the new column, any
hints please

use OpenOffice::OODoc;
my $doc = odfDocument(file => 'iwm.ods');

$row = 3;
while ( my $cli = $doc->cellValue(0, "D$row") ) {
my $username = get_customer_account( $dbh, $cli );
print "$cli => $username\n";
$doc->cellValue(0, "E$row", $username);
$row++;
}

$doc->save();


It's reading the spreadsheet fine, but it's not inserting the new
value into 'E' column

Try
$doc->updateCell(0, "E$row", $username);
 
G

Grehom

Grehomschrieb:






Try
$doc->updateCell(0, "E$row", $username);

Thanks, but I had already tried that, the problem I think is that
the table (0) I want to insert a fifth column into is only 4 columns
wide (when I open the spreadsheet you can see bold black outline
around the overall table size), I tried expanding the table but that
only seemed to widen the very last line of the table. I guess I
should just write a brand new table based on the old table and
delete the old table, but that seems rather crude.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top