Hello,
Please let me know:
1) How to repeatedly save the excel file that I am writing data to, sometimes my code, equipments dont work and all the collected data gets lost. I wanna save the excel file while it is being written. The data in excel is only visible if my .pl file completes execution. If for some reason it gets stuck the data is lost.
2) Also is there a way to open the excel file while data is being sent to the file? (My program controls various equipments and takes 6-7 hours to complete) therefore I wanna see whats being written to the excel file & save repeatedly
Please see the folloing code that I am using...
"
use strict;
use Spreadsheet::WriteExcel;
# Create a new Excel workbook called perl.xls
my $workbook = Spreadsheet::WriteExcel->new("XYZ.xls");
system("C:/Perl_Scripts/XYZ.xls");
# Add some worksheets
#my $sheet1 = $workbook->add_worksheet();
my $sheet1 = $workbook->add_worksheet("Summary");
.............................................
+...........................................
#this loops for 6-7 hours to collect data
$sheet2->write($i,0,$freqbk);}
$sheet2->write($i,$f+1,$pwr);
"
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.