Nadya,
I wrote a program to copy xls files from a server directory to my c:\. If a user has the file open, then my ON ERROR
routine will evaluate the error number returned by VFP. For example:
* CopyFiles.prg *
* if there is an error in any part of the program, pass it to ERRHAND.PRG *
ON ERROR DO C:\errhand WITH ;
ERROR(), MESSAGE(), MESSAGE(1), PROGRAM(), LINENO()
* errhand.prg *
PARAMETER errnum, mmessage, mmessage1, mprog, mlineno
DO CASE
*case:error= (108)file in use by another or (109)record in use by another? *
*(3) file is in use
CASE ERRNUM = 1102 && file being edited by someone else.
wait window 'The data cannot be updated until everyone is out of all spreadsheets.'+chr(13)+;
'Someone has at least one spreadsheet open on the server.' +chr(13)+;
'Click your mouse.'
quit && or do whatever other operation you need to do
CASE ERRNUM = 3 or ERRNUM=1705
* The file cannot be packed, try later. *
* just exit *.
ENDCASE
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only