in reply to Spreadsheet::WriteExcel question

I don't think you can do this with repeat_formula. I believe you can only replace cell references with other cell references. Some evidence for this: I would ask the maintainer of the module for confirmation of these ideas. As a workaround, you probably have to store the result of the calculation ($diff) in a cell and reference the cell.

Replies are listed 'Best First'.
Re^2: Spreadsheet::WriteExcel question
by vlilich (Initiate) on Jul 01, 2008 at 20:59 UTC
    figured it out... you can do number to number or cell reference to cell reference substitutions so that the following will work:
    my $formula1 = $ws->store_formula('=(12*9999)+MONTH($L39-1)-MONTH(A92) ++1'); my $diff=111; $ws->repeat_formula($row, $col, $formula1, $fmt->{'number'}, qw/^9999$/, $diff, qw/^A92$/, 'A' . $current_row );