oExcel = CREATEOBJECT("Excel.Application")
oWorkbook = oExcel.Workbooks.Open(cFilename)
oSheet = oWorkbook.Sheets(1)
oExcel.Visible = .T.
oSheet.Cells(1).Value = "Hello Mom"
You can save a macro in Excel and then convert it to VFP code by changing ActiveSheet to oSheet.
At the end you save and exit
oWorkBook.Save
oExcel.Quit
RELEASE oSheet
RELEASE oWorkbook
RELEASE oExcel