Hi guys, thanks for the response, I figured out to calculate the no of rows using SaveParser but using this I'm unable to save the modified row. Im posting my code , kindly provide any feedback or any thing that I'm missing

sub to_test { my ($self, $in_file) = @_; $count = @_; #To Test util->logit("[$PARENT_PROC_NAME]: in_file[$in_file]"); my $parser_temp = Spreadsheet::ParseExcel::SaveParser->new( CellHandler => \&cell_handler_1, NotSetCell => 0 ); util->logit("[$PARENT_PROC_NAME]: parser_temp[$parser_temp]"); my $sheet_ct = 0; my $Book = $parser_temp->Parse($in_file); util->logit("[$PARENT_PROC_NAME]: parser_temp[$parser_temp], glob_ +sheet_index[$glob_sheet_index],pre_row[$pre_row]"); @count_of_sheet_rows[$glob_sheet_index] = $pre_row; util->logit("[$PARENT_PROC_NAME]: count_of_sheet_rows_3[@count_of_ +sheet_rows], glob_sheet_index[$glob_sheet_index],pre_row[$pre_row]"); #my $workbook = Spreadsheet::WriteExcel->new(); #my $sheet_work = $parser_temp->worksheet(0); #$sheet_work->AddCell( 1, 0, 'Hi Excel!' ); my $temp = "temp"; my $new_path = "$out_file$underscore$temp$extension"; my $Saved_Workbook = $Book->SaveAs($new_path); foreach my $worksheet ($Book->worksheets()) { my $value_row = @count_of_sheet_rows[$sheet_ct]+2; my $value_cell = 0; util->logit("[$PARENT_PROC_NAME]: count value_row[$value_row], wor +ksheet[$worksheet]"); #$worksheet->AddCell(@count_of_sheet_rows[$sheet_ct] + 1, 0, local +time); $worksheet->AddCell($value_row, $value_cell, "World2"); ##$worksheet->AddCell( 1, 0, 'Hi Excel!' ); #$worksheet->write(@count_of_sheet_rows[$sheet_ct], 0, 'Hi Exce +l!'); $sheet_ct++; } #$Book->close(); #$Book->Close(); #$parser_temp->Quit(); #$Saved_Workbook->SaveAs($new_path); $Saved_Workbook->close(); #undef $Book; #undef $parser_temp; return $new_path; }

Kindly suggest something...


In reply to Re^4: Append new line in excel sheets by perl_new_b
in thread Append new line in excel sheets by perl_new_b

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.