Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

On exclusive open for write

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vezerid - 19 Jan 2006 19:41 GMT
I have identified the relevant threads and have read the pages in the
microsoft support website. Experts, please share with me:

>From reading the code I understand that the procedure is not
full-proof.

A function IsFileOpen attempts to open a file for I/O. It then closes
it and returns TRUE if an error was produced while attempting to open.

Then, the attempt to open at Excel-level is done through invocation of
IsFileOpen in an IF.

In other words, broadly speaking, we have the following sequence of
events:

Open at I/O level.
Close at I/O level.
Workbook.Open

Thus, it is possible that between the Close and Workbook.Open someone
else has opened the file. Am I correct? Am I missing something?

Is there a full-proof way to open a file exclusively for write and then
use object libraries with it?

Regards,
Kostis Vezerides
Tim Williams - 19 Jan 2006 23:07 GMT
Why don't you just try to open the file: if you can open it then why close
it again?
Just open it and keep it open, or raise an error if the file can't be
opened.

Tim

Signature

Tim Williams
Palo Alto, CA

> I have identified the relevant threads and have read the pages in the
> microsoft support website. Experts, please share with me:
[quoted text clipped - 23 lines]
> Regards,
> Kostis Vezerides
vezerid - 20 Jan 2006 13:08 GMT
It is because I want the file to work for multi-user access. The idea
is that SPR1.xls is used as a template for data entry by many users. By
clicking a button I want the elements of the form to be stored in a
central table, in SPR2.xls, located in the network. Therefore locking
issues are important.

Kostis
Tim Williams - 23 Jan 2006 18:09 GMT
That still doesn't explain why, if you want to write data to the file, you
don't just try to open it and then keep it open if you succeed.
I don't get why you open it and then immediately close it (only to open it
again later).

Signature

Tim Williams
Palo Alto, CA

> It is because I want the file to work for multi-user access. The idea
> is that SPR1.xls is used as a template for data entry by many users. By
[quoted text clipped - 3 lines]
>
> Kostis
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.