P
PJ Usher
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
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