Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 751
Default On exclusive open for write

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default On exclusive open for write

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

--
Tim Williams
Palo Alto, CA


"vezerid" wrote in message
oups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 751
Default On exclusive open for write

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default On exclusive open for write

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).

--
Tim Williams
Palo Alto, CA


"vezerid" wrote in message
oups.com...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i open the write protected excel file? Vipul Shukla Excel Discussion (Misc queries) 1 November 7th 08 08:33 AM
HOW TO OPEN A WRITE PROTECTED FILE (USB) Wendyanne Excel Discussion (Misc queries) 2 August 16th 06 01:38 PM
Need to write a program to open a filename... Flop Excel Programming 3 December 3rd 04 04:47 PM
Write in the spreadsheet having a form open lidmat Excel Programming 3 November 22nd 04 05:36 PM
Is this right (open for write access) John Pritchard Excel Programming 0 September 21st 04 04:50 PM


All times are GMT +1. The time now is 02:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"