oExcel = Createobject("Excel.Application") If Vartype(oExcel) != "O" * could not instantiate Excel object * show an error message here Return .F. Endif oWorkbook = oExcel.Application.Workbooks.Open ("C:\SAMPLE..xls") oExcel.Visible = .T. oExcel.Application.UserControl=.T. oExcel.Application.Interactive=.T. Clear oExcel.Quit()