Hi Bill, I had this problem too so try something like this:
my $dateVar = $worksheet->Cells( $row, $col )->{Value};
if ( ref $dateVar ) {
$theDate = $dateVar->ChangeType(VT_BSTR)->Value();
}
Hopefully, that works for you.
Michael | [reply] [d/l] |
ta for that. Looks like what I want (but I'll try it forst before confirming! :-) )
Bill
| [reply] |
Could you provide an example of your code? I'm confused by "date/value two column Range". Should it not be a single cell? (which Range objects can be used to acquire the value of) for example
my $date = $sheet->Range("A1")->{Value};
print $date."\n"
Please post your example code and I'll take a better look at what you're attempting.
| [reply] [d/l] |
Sorry... I should make it clear I meant I have a 2-column Excel spreadsheet with column A being formatted as a Date and column B being formatted as a number.
I can read it all into perl without any problems, but when I look at the eprl $vars, the B column of numbers indeed looks like numbers, but the column A date looks umm, some sort of horrible ref. which I don't understand.
Cheers
Bill
| [reply] |