>ex.. >report form myreport to (newtable or cursor) >********** >use (newtable or cursore) >gcDelimName = ALIAS( ) + '.xls' >gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls') >IF EMPTY(gcDelimFile) > CANCEL >ENDIF >COPY TO (gcDelimFile) XL5 >>thanks
SELECT * FROM MyTable INTO CURSOR cc1 ORDER BY 2,1 lnRecCount=_tally * copy to clipboard _vfp.DataToClip(,,3) * Specify xlt (Exel Template File) lcTemplate=ADDBS(SYS(5)+SYS(2003))+[Excel\Templates\AR_Report2.xlt] *lcTemplate=[] LOCAL oExcel as Excel.Application && to make intellisense happy oExcel=CREATEOBJECT("Excel.Application") oExcel.visible= .F. oExcel.DisplayAlerts = .F. oW=oExcel.Workbooks.Add(lcTemplate) * select sheet 1 ow.Worksheets[1].select oRange = oExcel.ActiveSheet.Range("A6:F"+TRANSFORM(6+lnRecCount)) oExcel.selection.PasteSpecial() * etc....Peter