Use employee =Table2ClipBoard() #include "xlconstants.h" oExcel = createobject("Excel.Application") With oExcel .Workbooks.Add .visible = .t. With .ActiveWorkbook.ActiveSheet .Paste .Range('A1').CurrentRegion.Replace("PMARK", ; ""+chr(10)+"",xlPart,xlByRows, .F.) Endwith For ix=1 to fcount() If type(field(ix))='M' With .Columns(ix) .ColumnWidth = 50 && Increase width for memo fields and set wrap on .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = .T. Endwith Endif Endfor Endwith Function Table2ClipBoard lcTempFileName = "X"+sys(2015)+".tmp" handle = fcreate(lcTempFileName) && Create a temp file #Define TABULATE chr(9) #Define NL chr(13) For ix = 1 to fcount() =fwrite(handle, field(ix)) If ix < fcount() =fwrite(handle, TABULATE) Endif Endfor =fwrite(handle, NL) Scan && Start scan..endscan For ix = 1 to fcount() && Write field values lcField = field(ix) =fwrite(handle, strtran(transform(&lcField), chr(13)+chr(10), "PMARK") ) If ix < fcount() =fwrite(handle, TABULATE) Endif Endfor =fwrite(handle, NL) Endscan lnSize=fseek(handle,0,2) =fseek(handle,0,0) _Cliptext = fread(handle, lnSize) && Read file to clipboard =fclose(handle) Erase (lcTempFileName)Cetin