Go Back   TechArena Community > Technical Support > Computer Help > Office Help > MS Office Support
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



"This file is locked. Try the command again later" message in a shared excel document

MS Office Support


Reply
 
Thread Tools Search this Thread
  #1  
Old 14-01-2012
Member
 
Join Date: Dec 2011
Posts: 59
"This file is locked. Try the command again later" message in a shared excel document

I am new to the Excel and I don?t have much information about this Excel application. I am getting one error massage "This file is locked. Try the command again later" for a spreadsheet that is shared to multiple people in multiple offices. They all go into the sheet at random times to edit but many are getting the same error message. Can someone explain why we get this message and how do I fix or avoid getting this in the future?

Reply With Quote
  #2  
Old 14-01-2012
Member
 
Join Date: Aug 2011
Posts: 564
re: "This file is locked. Try the command again later" message in a shared excel document

According to my information this is not an error or something like that, this is one of the information message that you receive when you try to save or close a shared file. The file gets saved anyways.
Reply With Quote
  #3  
Old 03-01-2014
Member
 
Join Date: Apr 2008
Posts: 4,086
Re: "This file is locked. Try the command again later" message in a shared excel document

You should try to close the file in Quick View before you try to save the shared workbook. If this doesnt work then another user might have opened the Shared Workbook so wait for sometime and save the file again. Usually the number of minutes to wait generally depends on the size of the file and how long it takes to open the file. For more information visit this website - http://support.microsoft.com/kb/129276
__________________
Ram requirement for various OS
Reply With Quote
  #4  
Old 04-01-2014
Member
 
Join Date: Nov 2009
Posts: 348
Re: "This file is locked. Try the command again later" message in a shared excel document

Can you try to add the below function in a VBE module:

Code:
Function IsFileLocked(filePath As String) As Boolean 
    On Error Resume Next 
    Open filePath For Binary Access Read Write Lock Read Write As #1 
    Close #1 
    If Err.Number <> 0 Then 
        IsFileLocked = True 
        Application.StatusBar = "Waiting for file to close" 
        Err.Clear 
    Else 
        IsFileLocked = False 
        Application.StatusBar = "" 
    End If 
End Function
And after that you should also add the below in the workbook module:

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) 
    Dim fName As String 
    fName = "your file name" 'file name goes here
    If IsFileLocked(fName) Then 
        MsgBox ("File is locked" & vbCrLf & "Please try again later") 
        Cancel = True 
    End If 
End Sub
Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Office Help > MS Office Support


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: ""This file is locked. Try the command again later" message in a shared excel document"
Thread Thread Starter Forum Replies Last Post
Getting message while accessing shared file in Windows 7 "You do not have permission to access" UTTIYA Networking & Security 5 23-03-2011 10:31 AM
Error "document not saved" when saving Excel sheets BansiJ Windows Software 3 31-07-2010 03:07 PM
Error Message "Word found locked fields during update" Balamani Windows Software 3 21-10-2009 05:36 PM
message "xls is locked for editing by ---" accessing excel workbook Alleysdad101 MS Office Support 8 24-07-2008 10:03 PM
Project Web Access via IE7: "Export Grid to Excel" cause VBSCRIPT (error) message: "The activeX control on which this feature depends could not be created" Theo-Dore Microsoft Project 2 17-01-2007 09:47 PM


All times are GMT +5.5. The time now is 04:45 AM.