|
hi,
i have written a script that interacts with MS Excel.
it extracts data from a database and populates an excel sheet.
there are some date fields in the database, but when the script writes the value in the sheet it writes it as a string. i tried formating the cells for date but it doesn't help.
Is there a way where i can convert the date value in a way that excel recognizes it.
here is the piece of code that i use.
sub setXLCellValue
{
my ($sheet, $row, $col, $val) = @_;
$sheet->Cells($row,$col)->{'Value'} = $val;
}
here $val is a string of the format MM/DD/YYYY...how do i convert it to date format that excel can recognize it. As i said earlier i have tried formatting the sheet, it does not help.
|
|
|
|
|
|
|
// |