LOCAL nRows, nMaxRows, lDataToClip lDataToClip = .F. SELECT * FROM tastrade!customer INTO CURSOR ccust nRows = RECCOUNT() + 1 && include the header *-- Open Excel oExcel = CREATEOBJECT("Excel.Application") WITH oExcel *-- Open the reusable Excel template file .WorkBooks.Open('d:\temp\excel_tmp.xls') *-- How many rows can be written to Excel? nMaxRows = .ActiveWorkBook.Activesheet.Rows.Count IF nRows < nMaxRows AND nRows <> 1 .Sheets("Sheet2").Select() .Range("A2").Select() SELECT ccust IF lDataToClip *-- create a tab delimited list to the clipboard _VFP.DataToClip(,,3) ELSE *-- This method does not include header info FileToStr_ClipText() ENDIF *-- Paste the data to Excel begining at cell "A2" of "Sheet2" .ActiveSheet.Paste() *-- Clear out the clipboard _ClipText = "" *-- Excel's version of SET SAFETY .DisplayAlerts = .F. *-- Save the file as a new name to keep template in tact. .ActiveWorkBook.SaveAs("d:\temp\newsheet.xls") ENDIF *-- Quit Excel .Quit() ENDWITH PROCEDURE FileToStr_ClipText() lcFile = SYS(2015)+".TXT" COPY TO (lcFile) DELIMITED WITH TAB _Cliptext = FILETOSTR(lcFile) ERASE (lcFile) ENDPROC>I have a need to EXPORT a table created by a query to EXCEL and target it to SHEET2