Hi, I' new to perl. I'm appending a row in the excel file. But a pop comes out(to save the temp file) while saving a file. Below is the code I'm using to do the same.

my $Excel = Win32::OLE->GetActiveObject('Excel.Application') | +| Win32::OLE->new('Excel.Application'); $Excel->{'Visible'} = 0; #0 is hidden, 1 is visible $Excel->{DisplayAlerts}=0; #0 is hide alerts # Open File and Worksheet util->logit("[$PARENT_PROC_NAME]: in_file[$in_file]"); my $Book = $Excel->Workbooks->Open($in_file); # open Excel file my $sheetcount = $Book->Worksheets->Count; #util->logit("[$PARENT_PROC_NAME]: sheetcount[$sheetcount]"); foreach my $i (1 .. $sheetcount) { #util->logit("[$PARENT_PROC_NAME]: i value [$i]"); my $Sheet = $Book->Worksheets($i); if(defined($Sheet)) { util->logit("[$PARENT_PROC_NAME]: Sheet[$Sheet]"); my $LastRow = $Sheet->UsedRange->Row + $Sheet->UsedRange-> +Rows->Count - 1; util->logit("[$PARENT_PROC_NAME]: LastRow[$LastRow]"); $Sheet->Cells($LastRow+1,1)->{Value} = localtime; } } #$Book->SaveAs(Filename =>$in_file); #my $file_ointer = $Book->Save(); #$Book->SaveAs(); $Book->SaveAs(); $Book->Close(); $Book->Quit(); undef $Book;

I need to save the changes without any manual efforts... Kindly suggest something. Thanks in advance.


In reply to Re^3: Problem using SaveAs when trying to change Excel format by Anonymous Monk
in thread Problem using SaveAs when trying to change Excel format by JRBJhawk

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.