Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does Foxpro know if an Excel workbook is being modified?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00443610
Message ID:
00443728
Vues:
12
Thanks for sharing your code, Jim. This is more general approach.
The original question was to find a way to determine, if Excell file is in use.
fopen(filename,12) will answer this question, I believe, regardless of file extension.

Thanks again.

>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
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform