+ Reply to Thread
Results 1 to 9 of 9

Set Statement Problem

Hybrid View

  1. #1
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Set Statement Problem

    WorkbookIsOpen is a custom function, I take it?

  2. #2
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562

    Re: Set Statement Problem

    It is a a custom function and here it is. The file name is passed and a Set statement is used to determine if the file is open. If the Set statement works, the file is open and if it doesn't, the file is not open. Basically, TC Rent Roll.xlsm is not being recognized by the Set statement in the function or the sub.

    Public Function WorkbookIsOpen(wbname) As Boolean
    
    ' Returns TRUE if the workbook is open
        
    Dim x As Workbook
    On Error Resume Next
    Set x = Workbooks(wbname)
    If Err = 0 Then
        WorkbookIsOpen = True
    Else
        WorkbookIsOpen = False
    End If
    
    End Function
    Sincerely,
    Jeff

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1