Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking whether a file is open in Excel
Message
 
To
30/03/2006 09:09:18
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01105716
Message ID:
01109188
Views:
37
>Thanks for the code, Gregory, and sorry for the delay.
>
>However, I'm sorry I could not adapt it to my needs, since, perhaps it was rather complex.
>
>Is there something simple, a simple command, just to check whether a particular excel file is open?
>
>Thanks,
>
>Regards,
>
>Steve

Try the code below..
lcFile = 'c:\docs\test.xls'
IF FOPEN('&lcFile',12) = -1
	MESSAGEBOX('File is opened by Somebody!',0+16,'',1500)
Else
    *MODIFY FILE &lcFile
    *FCLOSE('&lcFile')
Endif
Jojo R. dela Cuesta, B.Sc.
eConsultant, Programmer
Dalplus Technologies
http://www.dalplus.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform