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: 11
Default Testing if a workbook on the network is open

Excel 2000

I used the test open workbook code provided by Ron de Bruin on an earlier
post

Sub test()
If bIsBookOpen("test.xls") Then
MsgBox "Open"
Else
MsgBox "Not Open"
End If
End Sub

Function bIsBookOpen(ByRef szBookName As String) As Boolean
' Rob Bovey
On Error Resume Next
bIsBookOpen = Not (Application.Workbooks(szBookName) Is Nothing)
End Function

I found this only works if the excel documentB being tested is in the same
folder as the macro documentA. If documentB is open and in a different
folder the function will return a not open variable.
Is it possible to change this code to test document B located at a different
network folder to see if the document is open?
I tried to replace "test.xls" with "networkDrive:\network folder\test.xls"
and it did not work.

Thanks

PJ


 
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
testing for open workbook Gary Keramidas[_4_] Excel Programming 7 September 27th 05 09:05 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
Testing for open workbook nigelab Excel Programming 4 November 2nd 03 04:31 PM


All times are GMT +1. The time now is 09:43 PM.

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

About Us

"It's about Microsoft Excel"