+ Reply to Thread
Results 1 to 2 of 2

File Locked - When reopening a VBA created Document?

  1. #1
    Registered User
    Join Date
    10-14-2011
    Location
    Queensland
    MS-Off Ver
    Excel 2003
    Posts
    1

    File Locked - When reopening a VBA created Document?

    Hi, I have a piece of code that generates a new document from the current document (using ThisWorkbook.SaveAs sFilename). This can be then propagated through several documents.

    i.e.

    wkbk001.xlsm
    wkbk002.xlsm
    ... etc.

    The problem I am having is that when someone tries to open one of the former documents, it reports that it is locked for editing by 'another' user. It is not specific about which user, but I can usually go to another machine and open it without any problems (even if that was not the machine or user that created it).

    I have tried to disable the autosave (ThisWorkbook.EnableAutoRecover = False) thinking that maybe the original source document has a lock file open somewhere or a temp file open, but to no avail.

    It also seems to be slightly randomised as to which documents will come up with the error and which will not, and it varies also between the three different machines that I have tried.
    All machines are running Office 2010 on Windows 7.

    Any help appreciated.

    Here is my SaveAs function for reference:

    Please Login or Register  to view this content.

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

    Re: File Locked - When reopening a VBA created Document?

    Try the method 'SaveCopyAs'



+ 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