LOCAL nRows, nMaxRows, lDataToClip lDataToClip = .F. IF NOT DBUSED('tastrade') OPEN DATABASE _SAMPLES + "tastrade\data\tastrade" SHARED ENDIF 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:\dev\lexnet\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:\dev\lexnet\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 need to send my DBFs to Excel spredasheet with full functionality. I use the same procedure. All but one work fine. This particular procedure sends 17000 records to Spreadsheet with 12 columns.