LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Check if a workbook is open on a network.

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.
--
--
Mark Rosenkrantz
--


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Workbook using URL instead of network path Raul Excel Programming 5 March 1st 06 03:53 PM
How to check for an open network connection? vrk1 Excel Programming 0 June 20th 05 06:07 PM
How to check for an open Network connection in Excel VBA? vrk1 Excel Programming 0 June 18th 05 02:58 AM
Is workbook open anywhere in network? Miochael Bond Excel Programming 13 September 22nd 04 04:15 PM
Is workbook open on the network? ianripping[_85_] Excel Programming 7 July 29th 04 11:38 AM


All times are GMT +1. The time now is 07:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"