LOCAL oleApp AS "Excel.Application" TRY oleApp = GETOBJECT(, "Excel.Application") IF oleApp.Visible = .T. * do not close any visible instances of ms excel. ELSE oleApp.Quit() ENDIF CATCH * ignore any errors. FINALLY STORE .NULL. TO oleApp ENDTRY>I do a lot of Excel automation. So much that I have a standard stack of commands that I use over and over. oExcel = CreateObject("Excel Application") etc etc. Make an oBook object. Make an OSheet object. Get number of used rows. Iterate through the rows. Do something with the data. Close the Book. Quit Excel. and set the oExcel object to NULL.