create cursor curExcel ( i1 i, c1 c(10), t1 t ) insert into curExcel values ( 1, 'test 1', {^2005-09-10 01:23:45} ) insert into curExcel values ( 2, 'test 2', {^2005-01-01 13:45:01} ) insert into curExcel values ( 3, 'test 3', {^2005-12-31 23:59:59} ) loExcel = createobject( "excel.application" ) loExcel.Visible = .t. loWorkbooks = loExcel.Workbooks loWorkbooks.Add() loWorkbook = loExcel.ActiveWorkbook loSheet = loExcel.ActiveSheet n = afields( laFields ) scan loRow = loSheet.Rows( recno() ) for i = 1 to n loCol = loRow.Cells(,i) loCol.Value = evaluate( laFields[i,1] ) endfor endscan loCol = .null. loRow = .null. loSheet = .null. loWorkbooks = .null. loWorkbook.Close( .t., "test.xls" ) loWorkbook = .null. loExcel.Quit() loExcel = .null.