View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default Resume Next doesn't work in IsOpen function

I want to test if a workbook is open. I've found these suggestions, but none of them work for me. Any ideas why
Thank
Ro

'I've tried
Function IsOpen(BookName As String) As Boolea
On Error Resume Nex
Set wb = Workbooks(BookName
IsOpen = Not wb Is Nothin
End Functio

'and
Function IsOpen(BookName As String) As Boolea
On Error Resume Nex
IsOpen = Not (Application.Workbooks(BookName) Is Nothing
End Functio

'and
Function IsOpen(BookName As String) As Boolea
On Error Resume Nex
IsOpen = Len(Workbooks(BookName).Name
End Functio