>>>Hi everybody,
>>>
>>>I use Copy to (lcFile) type XLS and then apply custom formatting using the array of field names.
>>>
>>>Here is the code I just tried
>>>
>>>
>>>IF !EMPTY(taHeader_Info[m.lnK,3])
>>> loRange = loSheet.UsedRange.Offset(m.lnLines + m.lnOffset)
>>> loRange.COLUMNS[m.lnK].Select
>>> *loRange.COLUMNS[m.lnK].NumberFormat = taHeader_Info[m.lnK,3]
>>> loExcel.Selection.NumberFormat = taHeader_Info[m.lnK,3]
>>> ENDIF
>>>
>>>
>>>Unfortunately, it is still not working for dates.
>>>
>>>Is there any way to make number format to work on the existing spread sheet?
>>>
>>>Thanks a lot in advance.
>>
>>How about:
>>
>>loExcel.Selection.NumberFormat = "mm/dd/yy;@"
>>(not tested!)
>
>I passed laHeader_Info[lnI,3] = "mm/dd/yyyy;@" but it made no difference. The dates are still 23-Jul-08
Did you try just plain copy to ... XL5 ? If you have D field in VFP table, then I expect it will give you format mm/dd/yyyy automatically.