Pop up Read Only and Existing User !

E

Elton Law

Dear Expert,
Need to open a file from share drive.
Normally, it would pop a READ ONLY message if there is someone usigng it
already.
But I use VB script to open and run that file.
I can't see the read only warning ...
Is it possible to force read only windows (if any) as well as pop up a
windows saying who is using it
Thanks
Elton
 
L

LOFE

This will open the file in read only:

Workbooks.Open Filename:=MyFile, ReadOnly:=True

I'm not sure why you would need to see who has the file open if you want to
open it as read only but make sure you have display alerts turned on
(Application.DisplayAlerts = True) and step through the code to see what
happens when someone else has got the file open.

You can also add a Notify to the File Open command:

Workbooks.Open Filename:=MyFile, ReadOnly:=True, Notify:=True

But that kinda defeats the purpose of opening as Read Only to start with.
 

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