B
Brian Helterline
Hi Ken,
Syntax Error - there should not be quotes around $sheet.....
A funny coincidence, if you run this:
my $item = Variant(VT_DATE, 0 );
print $item->Date( "dd/MM/yyyy" );
what value to you get? (hint: 30/12/1899)
It seems you don't have a value in Cells(6,$CurCol)
I think you may be over working the problem. The value returned from the
cell
will already be a string that looks like a date. (At least it does on my
system)
One thing to note: if Excel has the date formatted as "dd/mm/yyyy", when I
get
the value of the cell, it looks like "mm/dd/yyyy" which is my default.
E.g. On my system, if the excel cell has the format dd/mm/yyyy and contains
Jan 15, 2003, Excel displays it as 15/01/2003 but if you execute:
print $sheet->Cells(6,$CurCol)->{Value}
I get '1/15/2003'
-brian
Ken Brown said:Trying to get excel formatted as dd/mm/yyyy into perl variable
seems to be ruturning ole::variant but i cant get any sense out of return
date
$$item = Variant(VT_DATE, "$sheet->Cells(6,$CurCol)->{Value}");
Syntax Error - there should not be quotes around $sheet.....
$$item = $$item->Date("dd/MM/yyyy");
it keeps returing 30/12/1899 - not overly helpful
any ideas?
A funny coincidence, if you run this:
my $item = Variant(VT_DATE, 0 );
print $item->Date( "dd/MM/yyyy" );
what value to you get? (hint: 30/12/1899)
It seems you don't have a value in Cells(6,$CurCol)
I think you may be over working the problem. The value returned from the
cell
will already be a string that looks like a date. (At least it does on my
system)
One thing to note: if Excel has the date formatted as "dd/mm/yyyy", when I
get
the value of the cell, it looks like "mm/dd/yyyy" which is my default.
E.g. On my system, if the excel cell has the format dd/mm/yyyy and contains
Jan 15, 2003, Excel displays it as 15/01/2003 but if you execute:
print $sheet->Cells(6,$CurCol)->{Value}
I get '1/15/2003'
-brian