UPDATE: I had a bug in the code, ParseExcel actually pulled the results of the formula very nicely, then I accidentally over-wrote it - D'OH!
Most holy of holies,
I have a program that reads in an Excel Spreadsheet, massages some data, and creates a new spreadsheet. I just noticed that when I read in a cell that contains a formula (SUM of some cells), it appears to be blank (or null). Is there a way to pull the formula from the cell? Preferably would like the evaluated answer, but the formula itself will suffice in a pinch. Some code snippets below...
my $inputfile = Spreadsheet::ParseExcel::Workbook->Parse($ExcelFileIn)
+;
my $insheet = $inputfile->Worksheet(0);
foreach $row ($insheet->{MinRow} .. $insheet->{MaxRow}) {
foreach $col ($insheet->{MinCol} .. $insheet->{MaxCol}) {
my $cell = $insheet->{Cells}[$row][$col];
... do some stuff with $cell ...
}
}
Many thanks for your insight...
Pete
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.