Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

notify file already open

Status
Not open for further replies.

hawley

Programmer
Dec 16, 2002
37
US
In an excel template there is a menu option that opens the "open file" dialog box. I choose a file from there and click okay. If someone else has it open there is no message saying so but the title bar has read only. I want the message to appear warning the user that so and so already has it open.

I did find the Notify option in the Open Event but there is a snag in that for me. I do get the following message:
"'new_file.xls' is being modified by Karen. Open as read-only?"

But when I select ok or cancel I get an error on the open line:
"Method 'Open' of object 'Workbooks' failed".

Any suggestions?
_________________________________________________________
Sub Open_Existing_Wkbk()
sFilename = Application.GetOpenFilename("All files (*.xls*), *.xlt*")
If sFilename = False Then
Exit Sub
Else
Workbooks.Open FileName:=sFilename, Notify:=False
End If
End Sub
________________________________________________________
 
Try this :-
'-----------------------------------------
Sub Open_Existing_Wkbk()
On Error GoTo Getout
sFilename = Application.GetOpenFilename("All files (*.xls*), *.xlt*")
If sFilename = False Then
Exit Sub
Else
Workbooks.Open FileName:=sFilename, Notify:=False
End If
Exit Sub
Getout:
End Sub
'---------------------------------------------


Regards
BrianB
Use CupOfCoffee to speed up all windows applications
================================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top