Hi everyone, another question. I found this function posted by Juan, but Im having trouble using it. here is my macro:
sub test()
'other macro stuff here
'Open
Workbooks.Open Filename:= _
"S:FileServerShared FilesUnsecuredUnsecured Contract Selector.xls", ReadOnly:=True
wait5:
Application.Wait (Now + TimeValue("0:00:05"))
If WBisOpen("Unsecured Contract Selector") = True Then
GoTo wait5
Else
MsgBox ("pasting info")
End If
End Sub
Function WBisOpen(Bk As String) As Boolean
Dim T As Workbook
Err.Clear
On Error Resume Next
Set T = Workbooks(Bk)
WBisOpen = Not (Err.Number > 0)
Err.Clear
On Error GoTo 0
End Function
It seems like when the other workbook opens, it stops the macro which checks to see if its open? i never get the msgbox! help!
Thanks
This message was edited by robfo0 on 2002-04-15 15:35
sub test()
'other macro stuff here
'Open
Workbooks.Open Filename:= _
"S:FileServerShared FilesUnsecuredUnsecured Contract Selector.xls", ReadOnly:=True
wait5:
Application.Wait (Now + TimeValue("0:00:05"))
If WBisOpen("Unsecured Contract Selector") = True Then
GoTo wait5
Else
MsgBox ("pasting info")
End If
End Sub
Function WBisOpen(Bk As String) As Boolean
Dim T As Workbook
Err.Clear
On Error Resume Next
Set T = Workbooks(Bk)
WBisOpen = Not (Err.Number > 0)
Err.Clear
On Error GoTo 0
End Function
It seems like when the other workbook opens, it stops the macro which checks to see if its open? i never get the msgbox! help!
Thanks
This message was edited by robfo0 on 2002-04-15 15:35