in reply to perl help

Perl can indeed "add some rows" (albeit not quite as you may imagine, since writing to an existing file -- esp. Excel, can be problematic). Try searching cpan.org (or your unix distos pre-packaged add-ons if it offers them) for "Excel."

As to "sample code" however... well, that's just not the way things work here. This is not a code-writing service, but, rather, a site where many will help you learn if you show a desire to do so. And the best way to do that is to update your question to show

And just BTW, even if 5.10 is the latest your unix can offer, you'll want to be aware that there are significant changes and enhancements in more recent versions, particularly those released since 5.16.


Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:

  1. code
  2. verbatim error and/or warning messages
  3. a coherent explanation of what "doesn't work actually means.

Replies are listed 'Best First'.
Re^2: perl help
by snemmal (Novice) on Dec 08, 2015 at 14:31 UTC
    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!

      " ... 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

      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...