View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.setup
Aggie G Aggie G is offline
external usenet poster
 
Posts: 13
Default File Location Hyperlink

I have an Excel file located on my company's share drive and I am sending the
file location path as a hyperlink in an email. I currently have the file
setup with code that basically will not allow another user to open the file
if someone else is in it. this is the code.

Private Sub Workbook_Open()
If ThisWorkbook.ReadOnly Then
MsgBox "File already in use"
ThisWorkbook.Close savechanges:=False
End If
End Sub

The problem I am having is this: I have created a hyperlink to the location
of this file that I want my managers to access in an email I will send out,
but now the code above doesn't prevent multiple people from accessing the
file. How can I make it so that if someone is already in the file, which they
accessed using the hyperlink in my email, others won't be able to open the
file using the same hyperlink until the first users exits the file?