in reply to Bug in Spreadsheet::WriteExcel?
It is documented behavior.
"Care should be taken with the values that are substituted. The formula returned by repeat_formula() contains several other tokens in addition to those in the formula and these might also match the pattern that you are trying to replace."
Try this instead:
#!/usr/local/bin/perl -w use strict; use Spreadsheet::WriteExcel; my $workbook = Spreadsheet::WriteExcel->new("test.xls"); my $worksheet = $workbook->addworksheet("foo"); my $formula = $worksheet->store_formula('=SUBTOTAL(9,A1:B1)'); foreach my $row (0..99) { $worksheet->write($row,0,$row+1); $worksheet->write($row,1,$row+1); $worksheet->repeat_formula($row,2,$formula,undef,qr/A1\b/,'A'.($row+ +1),qr/B1\b/,'A'.($row+2)); $worksheet->repeat_formula($row,3,$formula,undef,qr/A1\b/,'B'.($row+ +1),qr/B1\b/,'B'.($row+2)); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Bug in Spreadsheet::WriteExcel?
by thor (Priest) on May 07, 2003 at 17:16 UTC |