use invoice SELECT invoice EXPORT TO invenq.xls TYPE XLS FIELDS delidate, invno, stock oExcel = CREATEOBJECT([Excel.Application]) oWorkbook = oExcel.Workbooks.open("C:\WTS\MID\INVENQ.XLS") oExcel.Visible = .t. lnLastRow = oExcel.activesheet.UsedRange.Rows.Count lnLastCol = oExcel.activesheet.UsedRange.Columns.Count oExcel.activesheet.Range("A2:A"+TRIM(PADR(lnLastRow,11))).NumberFormat ='dd/mm/yyyy'where the delidate is a date type field.