Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invalid File Descriptor, file is already open by excel.
Message
From
26/01/2000 14:38:01
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
26/01/2000 13:04:52
Paul De Niverville
Deniverville Econometric Research Ltd.
Victoria, British Columbia, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00322977
Message ID:
00323045
Views:
22
>Hi,
>
>I have a program that copies a table to excel format. Sometimes the client has a previous version of the spreadsheet open and VFP cannot create a new file of the same name. At this point I get the error 1111 Invalid File Descriptor.
>
>There is probably a way of determining if a file is open by another application, before trying to create a new one of the same name.
>
>Any ideas,
>
>
>Paul


Paul,
You could check it with lowlevel functions (fopen(), fcreate()) :
lcExcelFile = "c:\myPath\myExcel.xls"
handle = fopen(lcExcelFile,12)
if handle < 0 and ferror() = 5 && In use - access denied
*....
else
=fclose(handle)
endif
But what I prefer is to create xls file with a unique name :
lcTempXLSFile = sys(2015)+".xls"

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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform