How to tell if xls is open?

C

c mateland

(Excel 2003)

I've seen information on this but still confused.

On a company network, I have Master.xls in a folder accessable by many
users.

Another workbook, Slave.xls, uses VBA to open Master.xls from the
network.

I want ...

a) ...Master.xls to open editable if NOT currently opened editable by
other users.
(Users having it open as read-only is irrelevant.)

b) ...to run other code if Master.xls IS currently opened editable by
another user.
(Users having it open as read-only is irrelevant.)

I've seen some code that first checks if the file is open. Is there
any way to perform this check by simply trying to open the file (as in
my scenario above)? I'm afraid in the split second between checking
and opening, another user might open it.

Also, I'm not sure if the other code I found was applicable on a
network with many users. It sounded more like it was being used on an
local machine and checking if a file was open in their session of
Excel.

Thanks in advance if anyone can get me started.

-Chuck
 
T

Tom Ogilvy

C

c mateland

Thanks a bunch, Tom! I re-read the code and it makes more sense now.
Still it's good to hear you say it works. <g>

-Chuck
 

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