+ Reply to Thread
Results 1 to 2 of 2

Open Workbook if not already opened

  1. #1
    gottahavit
    Guest

    Open Workbook if not already opened

    I am looking for a procedure that opens a workbook if it is not already open.
    How do I find out if a workbook is currently open?

    Thanks.

  2. #2
    galimi
    Guest

    RE: Open Workbook if not already opened

    The following code should work

    Sub isOpen()
    On Error GoTo notOpen

    Set xlTest = Workbooks("Workbook.xls")
    MsgBox "Workbook is open"
    Exit Sub

    notOpen:
    MsgBox "The workbook is NOT open"
    Workbooks.Open ("c:\Workbook.xls")

    End Sub

    Replace the Workbook.xls name with the actual name of your workbook. You'll
    also need to specify the path in the Workbooks.Open method in the second to
    last line.
    --
    http://HelpExcel.com
    1-888-INGENIO
    1-888-464-3646
    x0197758


    "gottahavit" wrote:

    > I am looking for a procedure that opens a workbook if it is not already open.
    > How do I find out if a workbook is currently open?
    >
    > Thanks.


+ 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