Clear all USE home()+"samples\data\orders" WAIT window nowait "Sending data to Excel..." lcTempExcelFile=sys(5)+curdir()+"X"+sys(2015)+".xls" COPY to (lcTempExcelFile) type xl5 && Copied to xls file PUBLIC oExcel oExcel = createobject("Excel.application") WITH oExcel .workbooks.open(lcTempExcelFile) && Open saved xls =_JustTest(oExcel) .visible = .t. && Done - show WAIT clear ENDWITH Release oExcel DECLARE integer GetForegroundWindow in WIN32API DECLARE short IsWindow in WIN32API integer lnExcelWindow = GetForegroundWindow() && Save Excel window handle DO while IsWindow(lnExcelWindow) # 0 && Loop while our Excel window alive ENDDO Clear dlls *Release oExcel ERASE (lcTempExcelFile) FUNCTION _JustTest LPARAMETERS toExcel WITH toExcel .Union(.Range("A:A"),.Range("2:4"), .Range("C6:F20")).select .Application.Selection.Font.Name = "Wingdings" ENDWITHCetin