+ Reply to Thread
Results 1 to 6 of 6

Is File Open in Another Session

  1. #1
    Valued Forum Contributor SDruley's Avatar
    Join Date
    04-27-2009
    Location
    Conover, NC
    MS-Off Ver
    Excel 2010 64 bit
    Posts
    415

    Smile Is File Open in Another Session

    Is there a way to check and see if a particular file is open in another session of Excel. I know how to open the file but lack the knowledge to check first if it is open.
    Last edited by SDruley; 06-20-2011 at 01:57 AM.
    Turn Data into Information
    Turn Information into Knowledge
    Turn Knowledge into Direction
    Turn Direction into Leadership
    Turn Leadership into Results
    Stephen Druley

    It's not how quickly you think
    But how deeply you think
    The quality of thinking is measured
    by remoteness to conformance
    Stephen Druley

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Is File Open in Another Session

    Hi SDruley, perhaps this example will help you out:

    http://www.vbaexpress.com/kb/getarticle.php?kb_id=468

    Hope it helps!

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Is File Open in Another Session

    That suggestion could be reduced to:

    Please Login or Register  to view this content.



  4. #4
    Valued Forum Contributor SDruley's Avatar
    Join Date
    04-27-2009
    Location
    Conover, NC
    MS-Off Ver
    Excel 2010 64 bit
    Posts
    415

    Smile Re: Is File Open in Another Session

    It is amazing how Excel vba programming can be a measure of how deeply one can think through a solution. I am totally blown away by snb's response here. Sensational programming.

  5. #5
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Is File Open in Another Session

    snb, since you already specified the variable c01 and set it to the file path/name, could you not use it in the IIf statement, e.g.
    Please Login or Register  to view this content.
    instead of
    Please Login or Register  to view this content.
    ?

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Is File Open in Another Session

    @Paul,

    Yes, of course. You are quite right. Thanks !
    You triggered me not to use a redundant variable at all, resulting in :
    Please scrutinize this as thoroughly as you did my previous suggestion.

    Please Login or Register  to view this content.
    Please scrutinize this code as thoroughly as you did my previous suggestion.
    Last edited by snb; 06-20-2011 at 02:54 PM.

+ 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