Ron de Bruin Wrote:
Hi vumian
Not needed that the file or sheet is active when you copy
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
Oh, it work great . thank you very much
a good man.
--
vumian
------------------------------------------------------------------------
vumian's Profile:
http://www.excelforum.com/member.php...o&userid=36494
View this thread:
http://www.excelforum.com/showthread...hreadid=564102