Read/Write Alert

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?
 
D

Dave Peterson

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
 
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top