local lcXLSFile,lcTemp lcXLSFile = "c:\temp\myFile.xls" select First_Name, last_Name from employee into cursor crsTemp copy to (m.lcXLSFile) type xls Select Company,Contact from customer into cursor crsTemp lcTemp = sys(2015)+'.tmp' copy to (m.lcTemp) type delimited with "" with tab _cliptext = "Company"+Chr(9)+"Contact Name"+Chr(13)+FileToStr(m.lcTemp) erase (m.lcTemp) use in "crsTemp" #define xlRangeAutoFormatColor2 8 oExcel = createobject("Excel.Application") with oExcel .WorkBooks.Open(m.lcXLSFile) With .ActiveWorkBook.ActiveSheet .Range("D5").PasteSpecial .Application.Selection.Columns.Autoformat(xlRangeAutoFormatColor2) .Range("A1").Activate endwith .Visible = .T. endwithCetin