in reply to Re: perl help
in thread perl help

use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::SaveParser; use Spreadsheet::WriteExcel; # Open an existing file with SaveParser my $parser = Spreadsheet::ParseExcel::SaveParser->new(); my $template = $parser->Parse('MyExcel.xls'); my $worksheet = $template->worksheet('Firstsheet'); my $chart = $template->add_chart( type => 'line' ); $chart->add_series( categories => '=URV!$A$17:$A$442', values => '=URV!$D$17:$D$442', name => 'pended graph', );
This is what i tried... here i am opening an already existing excel sheet (MyExcel.xls) going to its first sheet (Firstsheet) and then adding a chart to it.... error: Can't call method "add_chart" on an undefined value at charts4.ps line 20 my perl version : This is perl 5, version 22, subversion 0 (v5.22.0) built for aix I am expecting a chart displayed with the existing data in the existing excel.. i know charts work when we use my $workbook = Spreadsheet::WriteExcel->new( 'chart_column.xls' );... but i dont want to create a new excel sheet.. i want - open my existing excelsheet and the add chart to this already existing excel sheet.. Thanks in advance!

Replies are listed 'Best First'.
Re^3: perl help
by ww (Archbishop) on Dec 08, 2015 at 15:23 UTC

    " ... i want - open my existing excelsheet ....

    And I want a pony.

    But, as explained in the first (and so far, only) answer to your StackOverflow post, if Santa (or, more likely, the Grinch) brings you the pony you're asking for it will be (at best) a bucking, unbroken and untrustworthy bronco. You don't really want to have to ride that one.

    And please, when you post, read the formatting instructions at the text-entry box! CODE TAGS! <c> code here </c>


    Come, let us reason together: Spirit of the Monastery
      FYI - This question is not yet answered in stackoverflow.. I am still trying it online and offline (in my system) too
Re^3: perl help
by Corion (Patriarch) on Dec 09, 2015 at 14:53 UTC

    I find this error message highly suspect. You claim that the above is (part of) the code you run, but there is very little chance that the call to ->worksheet() succeeds while the call to ->add_chart fails due to $template not being defined.

    Please post a short, self-contained example so that we can replicate your problem.

      Thanks for looking into this. I am parsing an existing excel sheet and adding chart to this excel sheet. i am using use Spreadsheet::ParseExcel::SaveParser; to parse. in this parsing mode i am able to add some rows to excel sheet, but adding charts in this parse mode is failing. Not at all able to add/insert chart to existing excel. Please try to add chart to an existing excel sheet using perlscript...