S
Spreadsheet Solutions
Dear all;
I need to check if someone on the network is using a workbook called "BRS".
How do I do that ?
I have this function (by Andy Pope), but can't get it to work.
'-----------------------------------------------------------------
Function IsNetworkFileOpen(Filename As String)
'-----------------------------------------------------------------
Dim nFile As Long
IsNetworkFileOpen = False
nFile = FreeFile()
On Error Resume Next
Open Filename For Input Lock Read Write As #nFile
If Err <> 0 Then
If Err.Number = 70 Then
IsNetworkFileOpen = True
Else
IsNetworkFileOpen = "No such file"
End If
End If
On Error GoTo 0
Close #nFile
End Function
'-----------------------------------------------------------------
Were does Workbooks("BRS.xls") comes into play ?
Many thanks beforehand.
I need to check if someone on the network is using a workbook called "BRS".
How do I do that ?
I have this function (by Andy Pope), but can't get it to work.
'-----------------------------------------------------------------
Function IsNetworkFileOpen(Filename As String)
'-----------------------------------------------------------------
Dim nFile As Long
IsNetworkFileOpen = False
nFile = FreeFile()
On Error Resume Next
Open Filename For Input Lock Read Write As #nFile
If Err <> 0 Then
If Err.Number = 70 Then
IsNetworkFileOpen = True
Else
IsNetworkFileOpen = "No such file"
End If
End If
On Error GoTo 0
Close #nFile
End Function
'-----------------------------------------------------------------
Were does Workbooks("BRS.xls") comes into play ?
Many thanks beforehand.