If you want to avoid use an On Error block, try following function :
Function IsWBOpen(strName As String) as Boolean
Dim w as Workbook,
Dim bResult as Boolean
bResult = False
For each w in Workbooks
if w.name = strName then
bResult = True
exit for
end if
Next
IsWBOpen = bResult
End Functio
--
Message posted from
http://www.ExcelForum.com