Read/Write Alert

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Many users access data for my application. The data is stored on seperate xl
files. These data files only open long enough for information to be retrieved
form or saved to, then the file is closed. If by chance the file to be opened
is already open by another user and in a Read Only state, my application
displays a MsgBox to "try again". However, a default windows message appears
well after this event, advising that the file is now Read Write and available.
Is there any way to prevent this Windows message from appearing, similar to
setting DisplayAlerts to false?
 
If you only need to read the file, you can open it in readonly mode. There's an
option on the workbooks.open statement that you can read about in VBA's help.

If you have to update the file, you can test to see if the file is in use
elsewhere:

Macro Code to Check Whether a File Is Already Open
http://support.microsoft.com/?kbid=138621
 
Excellent, thanks Dave.
I was having the file opened, then checking If ActiveWorkbook.ReadOnly,
which if Yes, set off an auto response later on from Windows that the read
only file was now available, which was creating confusion for the users.
Gold Star for you :)
 
Back
Top