Re: Unknown defined name DATEVALUE in formula

97 views
Skip to first unread message

jmcnamara

unread,
Aug 20, 2012, 6:37:12 AM8/20/12
to Spreadsheet::ParseExcel
On Aug 20, 11:04 am, Costi <constantinmihaiste...@gmail.com> wrote:

> $worksheet->write_formula($row, $col, '=DATEVALUE("%s", $field[$j])', $format_date);


Hi,

The issue here is that single quotes don't allow interpolation
(variable evaluation) in perl. For example consider the output of the
following:


my $str = 'Hello';

print '$str'; # Prints: $str
print "\n";

print "$str"; # Prints: Hello
print "\n";

So you probably need something like this:

$worksheet->write_formula($row, $col, "=DATEVALUE($field[$j])",
$format_date);

See the following for more information:

http://perlmeme.org/howtos/using_perl/interpolation.html


P.S., This question should have been posted to the
Spreadsheet::WriteExcel forum.

John.
--

jmcnamara

unread,
Aug 20, 2012, 6:38:46 AM8/20/12
to Spreadsheet::ParseExcel

On Aug 20, 11:04 am, Costi <constantinmihaiste...@gmail.com> wrote:

> $worksheet->write_formula($row, $col, '=DATEVALUE("%s", $field[$j])', $format_date);


Hi,

The issue here is that single quotes don't allow interpolation
(variable evaluation) in perl. For example consider the output of the
following:


my $str = 'Hello';


print '$str'; # Prints: $str
print "\n";


print "$str"; # Prints: Hello
print "\n";


So you probably need something like this:


$worksheet->write_formula($row, $col, "=DATEVALUE($field[$j])",
$format_date);


See the following for more information:


http://perlmeme.org/howtos/using_perl/interpolation.html


John.
--
Reply all
Reply to author
Forward
0 new messages