m.a=thisform.text2.Value CLOSE all USE (m.a) gcDelimName = ALIAS( ) + '.xls' gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls') IF EMPTY(gcDelimFile) && Esc pressed CANCEL ENDIF *** Let's see if the file is OPEN fHnd = FOPEN(gcDelimFile,12) IF fHnd < 0 ********** File is Open. You can't copy to it ******* Put Messagebox() with error CANCEL ENDIF FCLOSE(fHnd) COPY TO (gcDelimFile) xl5 && I prefer XL5 instead of XLS DECLARE INTEGER ShellExecute IN SHELL32.DLL INTEGER nWinHandle,; STRING cOperation,; STRING cFileName,; STRING cParameters,; STRING cDirectory,; INTEGER nShowWindow result = ShellExecute(0, 'Open', gcDelimFile , '', '', 1) ** with the code above You can handle errors returned by ShellExecute DO CASE CASE result == 0 && The system is out of memory or resources. CASE result == 2 && Bad Association (for example, invalid URL) CASE result == 29 && Failure to load application CASE result == 30 && Application is busy CASE result == 31 && No application association ENDCASE