Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open an existing Excel file
Message
From
13/05/2005 11:48:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
13/05/2005 11:39:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Novell 6.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01013850
Message ID:
01013903
Views:
12
>Not sure what you mean. I am using the following code..
>
>oExcel = CREATEOBJECT("Excel.Application")
>oExcel.Visible = .T.
>oBook = oExcel.Workbooks.FOPEN(xlFile)
>oSheet = oBook.ActiveSheet
>
>and it will allow me to open it and write to it even though it is ReadOnly. I want to prevent this from opening until someone else is done using it.

I didn't know excel had an fopen(), does it really (versions I've do not)?
lnHandle = FOPEN(m.xlFile,12)
llNotInUse = (lnHandle > 0)
if m.llNotInUse
 fclose(m.lnHandle)
 *oExcel.WorkBooks.Open(m.xlFile)
 *...
else
* check ferror etc
endif
Or open with notification:
oExcel.Workbooks.Open(m.xlFile,,,,,,,,,,.t.) && Use notification
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