http://www.perlmonks.org?node_id=997021

vikram007 has asked for the wisdom of the Perl Monks concerning the following question:

Hi i am not able to get formula calculated value into other cell in excel .

i am using linux os

example

A1 =4 A2 =5 A3 = =SUM(A1:A2)

how will i copy calculated value of sum to other cell or retain on the same cell these module i am using .

use Spreadsheet::WriteExcel; use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::Worksheet; use Parse::RecDescent; use Spreadsheet::WriteExcel::Utility; use Spreadsheet::ParseExcel::SaveParser; use Spreadsheet::ParseExcel::Cell;

i wanted copy or retain that calculated value of formula at the same cell.

problem: when i am saving excel sheet than i am getting 0 value at formulated cell. i want to retain that calculated value at the same cell

Replies are listed 'Best First'.
Re: copy and pest on linux
by marto (Cardinal) on Oct 03, 2012 at 09:32 UTC
Re: copy and pest on linux
by marto (Cardinal) on Oct 03, 2012 at 10:09 UTC

    Thanks for your update, though it'd be better if the changes to the post were made clear. You post a list of modules but don't show us any of your code (I asked you to read and understand How do I post a question effectively?) which produces the output

    Consider updating your post and actually reading the documentation for the modules you're using, for example Spreadsheet::ParseExcel:

    "This module cannot read the values of formulas from files created with Spreadsheet::WriteExcel unless the user specified the values when creating the file (which is generally not the case). The reason for this is that Spreadsheet::WriteExcel writes the formula but not the formula result since it isn't in a position to calculate arbitrary Excel formulas without access to Excel's formula engine."

Re: copy and pest on linux
by pvaldes (Chaplain) on Oct 03, 2012 at 11:05 UTC

    not related with your question, but I would suggest to write this:

    use Spreadsheet::WriteExcel; use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::Worksheet; use Parse::RecDescent; use Spreadsheet::WriteExcel::Utility; use Spreadsheet::ParseExcel::SaveParser; use Spreadsheet::ParseExcel::Cell;

    like this:

    use Parse::RecDescent; use Spreadsheet::WriteExcel qw(Utility); use Spreadsheet::ParseExcel qw(SaveParser Cell Worksheet);

    Untested but you can get the idea. If you need more functions from the module simply put its names inside qw(), or use qw(all), or omit the qw part: