Re: Resume Next doesn't work in IsOpen function

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Vasant Nanavati (vasantn)
Date: 06/04/04


Date: Fri, 4 Jun 2004 12:17:17 -0400

OK, let's take it step by step. *What* error message do you get?

For the example you gave, have you declared the variable wb?

-- 
Vasant
"Rob" <anonymous@discussions.microsoft.com> wrote in message
news:11C95D3C-A2C2-4CE0-9773-E63447D66594@microsoft.com...
> When I step through (or run the code of the function), I still get the
error message on the second line below, where I expect it to just continue
onto the next line.
>      >     On Error Resume Next
>      >     Set wb = Workbooks(BookName)
>      >     IsOpen = Not wb Is Nothing
>
>
>      ----- Vasant Nanavati wrote: -----
>
>      What does "none of them work for me" mean?
>
>      -- 
>
>      Vasant
>
>      "Rob" <anonymous@discussions.microsoft.com> wrote in message
>      news:98F8E674-2382-4AF0-B0A3-0D2E89CFE099@microsoft.com...
>      > I want to test if a workbook is open.  I've found these
suggestions, but
>      none of them work for me.  Any ideas why?
>      > Thanks
>      > Rob
>      >> 'I've tried:
>      > Function IsOpen(BookName As String) As Boolean
>      >     On Error Resume Next
>      >     Set wb = Workbooks(BookName)
>      >     IsOpen = Not wb Is Nothing
>      > End Function
>      >> 'and:
>      > Function IsOpen(BookName As String) As Boolean
>      >     On Error Resume Next
>      >     IsOpen = Not (Application.Workbooks(BookName) Is Nothing)
>      > End Function
>      >> 'and:
>      > Function IsOpen(BookName As String) As Boolean
>      >     On Error Resume Next
>      >     IsOpen = Len(Workbooks(BookName).Name)
>      > End Function
>      >


Relevant Pages

  • Re: Resume Next doesnt work in IsOpen function
    ... When I step through, I still get the error message on the second line below, where I expect it to just continue onto the next line. ... > Function IsOpen(BookName As String) As Boolean ...
    (microsoft.public.excel.programming)
  • Re: Cannot Close Archive Folder
    ... "Rob" wrote in message ... > I have deleted an old archive, but when I open outlook it ... > still shows the archive folder. ... > I get an error message which says "Operation Failed, ...
    (microsoft.public.outlook.general)
  • Re: mount & umount read-only floppy: unmount failed: Input/output error ??
    ... Rob wrote: ... > What might be improved is an error message from mountat the time of ... The mount command has been done and the ... I still think this falls into the category 'bug'. ...
    (freebsd-questions)
  • Re: [Error number: 0x80070005]
    ... click install now it will go up to 100% then show the error message ... register wuaueng.dll it comes up with an error message that it can not do ... "Rob" wrote: ... > Hi Mike, ...
    (microsoft.public.windowsupdate)
  • Re: MS Acces to SQL issues
    ... Do you get an error message? ... > Hello all - We have several small Access dBs that we want to move up to MS ... We've had some success with the upsizing wizard but have issues. ... > Rob C, MCSE, CCA ...
    (microsoft.public.sqlserver.server)