Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does Foxpro know if an Excel workbook is being modified?
Message
 
 
To
20/11/2000 09:50:08
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00443610
Message ID:
00443725
Views:
9
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


P.S. Sorry Nadya, I thought you were the one asking this question.
Previous
Reply
Map
View

Click here to load this message in the networking platform