View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
tolgag[_31_] tolgag[_31_] is offline
external usenet poster
 
Posts: 1
Default How to find if a workbook is open

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