Hi David,
First post to this list, so hi folks, pleasure to meet you all.
To get the text (i..e showing currency symbols etc.) out of a field
instead of the numeric value, use the Text property instead of Value
property.
sub toLetter {
return chr(64+$_[0]);
}
$ReadData = $ReadSheet->Range(&toLetter($LastCol).'1')->{Value};
print "$ReadData\n";
my $ReadData = $ReadSheet->Range(&toLetter($LastCol).'1')->{Text};
print "$ReadData\n";
On another note, I couldn't get your sample code to work because
$LastCol was returning as a number, not a column letter reference, so
I knocked together a quick and dirty converter - you may need to
expand this slightly to handle AA etc, or post back to let me know how
you do cell referencing.
I learned from your code how to use named parameters with OLE, so thanks!
i.e. SearchDirection=>xlPrevious,
--
Colm Gallagher
On Wed, 25 Aug 2004 15:41:00 -0400, DiGregorio, Dave
<[EMAIL PROTECTED]> wrote:
> Hey All,
>
> So I am building this app that parses and Excel spreadsheet for
> a value based on the last column in the file. But, I seam to return the
> Numeric value as opposed to the Alpha Value. Is there an easy way to get
> around this??
>
> $LastCol = $ReadSheet->UsedRange->Find({What=>"*",
>
> SearchDirection=>xlPrevious,
>
> SearchOrder=>xlByColumns})->{Column};
>
> print "$LastCol\n" ;
>
> $ReadData = $ReadSheet->Range($LastCol.'4')->{Value} ;
>
> Thanks
>
> David R. DiGregorio
>
> 703 Rodi Road
>
> Pittsburgh, PA 15235
>
> p. 412-349-2440
>
> [EMAIL PROTECTED]
>
>
--
Colm
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>