Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking whether a file is open in Excel
Message
De
03/04/2006 07:17:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
02/04/2006 12:52:27
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01109158
Message ID:
01109894
Vues:
49
>Dear Borissov,
>
>Thanks for all the help. I do not know how I put in that fclose() at that point. I was experimenting with various permutations and combinations, and inadvertently sent in that piece of code to you. Feels stupid, all the same..!
>
>But you were right about placement of the fclose()
>
>I have presently adapted Cetins code, with your fclose() location suggestion, and got the right result. My final code is below:
>
>
>lnHandle = fopen('c:\devstudio\panorama\PTYG.xls',12)
>if m.lnHandle > 0
>	MESSAGEBOX("File is NOT open")
>else
> 	lInUse = .t.
>	MESSAGEBOX("File is open")
>ENDIF				
>fclose(m.lnHandle)
>
>
>With best regards,
>
>Steve.

Steve,
For a moment I thought if it was me who placed fclose() wrongly:) Why do you need to 'adapt' the code I wrote, it was already clear (except file's name):
local lInUse
lnHandle = fopen("c:\myPath\myFile.xls",12)
if m.lnHandle > 0
 fclose(m.lnHandle)
else
 lInUse = .t.
endif
* add messagebox here
MessageBox( "File is"+ iif(m.lInUse,""," NOT") + " open." )
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform