Look at the example in my reply in your other thread
You can test if a file is open with this function
Function bIsBookOpen(ByRef szBookName As String) As Boolean
' Rob Bovey
On Error Resume Next
bIsBookOpen = Not (Application.Workbooks(szBookName) Is Nothing)
End Function
Use like this
If bIsBookOpen("test.xls") Then
--
Regards Ron de Bruin
http://www.rondebruin.nl
"vumian" wrote in message
...
hi man,
do you know this, help me pls
i've got this function to check another file opened ?
Public Function gbIsWBOpen(rsName As String) As Boolean
On Error Resume Next
gbIsWBOpen = Len(Workbooks(rsName).Name)
On Error GoTo 0
End Function
sub check_open
if gbIsWBOpen("abc.xls").active = true then
'do function
else
msgbox "error"
end if
end sub
what's wrong with this man ?
thank you.
--
vumian
------------------------------------------------------------------------
vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494
View this thread: http://www.excelforum.com/showthread...hreadid=565629