ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to find out if an excel spreadsheet is already open (https://www.excelbanter.com/excel-programming/402375-how-find-out-if-excel-spreadsheet-already-open.html)

GrantW

How to find out if an excel spreadsheet is already open
 
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\NSRD B\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

Frederik[_3_]

How to find out if an excel spreadsheet is already open
 
Have a look at

http://www.j-walk.com/ss/excel/tips/tip54.htm

a great source of inspiration!!!

greetz

"GrantW" schreef in bericht
...
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\NSRD B\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





All times are GMT +1. The time now is 10:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com