G
Guest
Hello,
The company I work for has a network and when a shared file is open, I
ususally get a pop-up box that asks if I want to open the file as read only,
wait for notificatin that the file is OK to open or cancel. I have written
some code (see attached) and I don't get this box pop-up box letting me know
that the file is already open and this creates file integrity problems if the
file is already open by another user.
I think I want the pop-up box, and I am open to other suggestions. Any
ideas how to write the code?
IsOpen = False
For Each wb In Workbooks 'check thru all open workbooks
If wb.Name = "Master Log.xls" Then 'change to your file's name
IsOpen = True 'your file is already
End If
Next wb
If IsOpen = False Then
Workbooks.Open Filename:="\\Tuc-nas\Master Log\Master Log.xls"
'This opens the other workbook if it was
closed
End If
Thanks,
Cameron
The company I work for has a network and when a shared file is open, I
ususally get a pop-up box that asks if I want to open the file as read only,
wait for notificatin that the file is OK to open or cancel. I have written
some code (see attached) and I don't get this box pop-up box letting me know
that the file is already open and this creates file integrity problems if the
file is already open by another user.
I think I want the pop-up box, and I am open to other suggestions. Any
ideas how to write the code?
IsOpen = False
For Each wb In Workbooks 'check thru all open workbooks
If wb.Name = "Master Log.xls" Then 'change to your file's name
IsOpen = True 'your file is already
End If
Next wb
If IsOpen = False Then
Workbooks.Open Filename:="\\Tuc-nas\Master Log\Master Log.xls"
'This opens the other workbook if it was
closed
End If
Thanks,
Cameron