+ Reply to Thread
Results 1 to 2 of 2

Excel Function/Code to See if Workbook is Open and activate based on a cell value

  1. #1
    Registered User
    Join Date
    11-30-2009
    Location
    New Jersey, United States
    MS-Off Ver
    Excel 2003
    Posts
    1

    Excel Function/Code to See if Workbook is Open and activate based on a cell value

    I am trying to find a code to help me check if a particular workbook is open using a value from a cell that has a v-lookup in it. If the workbook is open, I want to activate it , and add a sheet to the workbook. If the workbook is not open, I would like to create one.

    The code below only works when the workbook is not open.

    The problem I am having is that, when the particular workbook is open – the Function is not finding it, and always creating a new workbook.

    I am using a function “WorkbookOpen” to check if the workbook is open.
    The cell value is  NewName = Range("B7").Value
    B7 Contains a V-lookup.


    Can someone please assist?

    Code below:
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 11-30-2009 at 01:45 PM. Reason: Added Code Tags

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Excel Function/Code to See if Workbook is Open and activate based on a cell value

    If your code fails to find the workbooks even after they've created them once, then your syntax in the macro isn't taking into account your text strings properly.

    What exactly is in B7 and B8?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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