Is workbook open on network drive

  • Thread starter Thread starter Spencer Hutton
  • Start date Start date
S

Spencer Hutton

Is there a way to tell if a workbook is open on a network drive? If someone
has this workbook open, there name will be in sheet1 range A1.

Is there a statement that can tell me 1. if the workbook is open and 2. the
name of the person who has it open (range A1)?

i have played with referring to it as such, but am not sure of the rest of
the code i should use.

workbooks("\\servername\folder name\file name.xls")
 
Is there a way to tell if a workbook is open on a network drive? If someone
has this workbook open, there name will be in sheet1 range A1.

Is there a statement that can tell me 1. if the workbook is open and 2. the
name of the person who has it open (range A1)?

i have played with referring to it as such, but am not sure of the rest of
the code i should use.

workbooks("\\servername\folder name\file name.xls")

Open on your machine? This won't account for mapped drives, but it may give
you a start

Dim wb As Workbook

On Error Resume Next
Set wb = Workbooks("BackOrderReport.xls")
On Error GoTo 0

If wb Is Nothing Then
MsgBox "Workbook not open"
Else
If Left$(wb.Path, 2) = "\\" Then
MsgBox "Workbook open on network drive by " &
wb.Sheets(1).Range("a1").Value
Else
MsgBox "Workbook open locally"
End If
End If
 

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

Back
Top