date format in excel spreadsheet

tjsingh

Member
Hi

i have created a report which outputs to excel.

But for some reason when i export some of the cells are im mdy format but others are dmy. i need it in dmy.

but when i message the data is shows correctly

how can i resolve this one?
 

Osborne

Active Member
I had a similar problem and solved it by converting the date to a string first. E.g.:

vdate = STRING(MONTH(order.orddate), "99") + "/" + STRING(DAY(order.orddate), "99") + "/" + STRING(YEAR(order.orddate), "9999").
chWorksheet:Range(vrange):Value = vdate.
chWorksheet:Range(vrange):NumberFormat = "dd/mm/yy;@".
 
Top