How to find out if an excel spreadsheet is already open

G

GrantW

I am building an excel application which draws it's information from another
workbook called "NSRDB.xlsx. I need to find some code to include in some of
the macros, which checks if NSRDB.xlsx is already open by other users on our
network. I used to use the following:

'Application.DisplayAlerts = False

'Workbooks.Open_
Filename:="\\Caffeine\a3_personnel_management\NSRDB\NSRDB.xlsx"

If ActiveWorkbook.ReadOnly Then ActiveWindow.Close: GoTo AlertMessage

Is there any code I can use which will check if the file is open, regardless
of whether it is open as read-only or open otherwise.

Any help you can provide is greatly appreciated.

Grant W
 

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