+ Reply to Thread
Results 1 to 4 of 4

Locked For Editing

  1. #1
    Forum Contributor
    Join Date
    03-24-2005
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    378

    Locked For Editing

    How do I determine if a file is locked for editing?

    I have the following code in the ThisWorkbook module of a workbook maintained by our accounting dept. The P:\ Drive is a public folder on our server.
    Please Login or Register  to view this content.
    It works almost 100% of the time. However, if someone happens to have the copy open (I think that is when it happens) and accounting saves their version, the result is the copy in the public folder become corrupted.

    If I manually open a file in the public folder and someone else has it open, I get a dialog telling me the file is already in use by "AnotherUser" and is locked for editing. See picture attached.

    What would be the property to tell me this, so I can bypass the "SaveCopyAs" routine if the file is locked for editing?
    Attached Images Attached Images
    Thanks!
    Dennis

    I am using Windows 7 and Office 2007, all of my posts are based on this.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    You can look at

    Please Login or Register  to view this content.
    which will return the value of TRUE when someone else has the file open.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    This Function checks if a file is open

    Please Login or Register  to view this content.
    Use it like this

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Contributor
    Join Date
    03-24-2005
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    378

    Good Morning and Thank You!!!

    I modified the module in ThisWorkbook as below using your function.

    Please Login or Register  to view this content.

+ 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