gymolz.blogg.se

Excel file locked for editing how to unlock
Excel file locked for editing how to unlock




Make powerful macros with our free VBA Developer Kit Path & "\usage.log" For Input Access Read As # file1 Do While Not EOF ( file1 ) Line Input # file1, strLine Loop Close # file1 MsgBox "The file was locked by following user: " & strLine 'last line of file" End If End Sub Path & "\usage.log" For Append As # file1 Print # file1, Environ ( "USERNAME" ) & " at " & Now () Close # file1 Else 'if someone else has the file open, find out who Open ThisWorkbook. ReadOnly = True Then 'only add name to the usage log if the user has it locked Open ThisWorkbook. Path & "\usage.log" ' delete the file if it exists and it is possible End If On Error GoTo 0 ' break on errors End Sub Private Sub Workbook_Open () Dim file1 As Integer Dim strLine As String file1 = FreeFile If Not ActiveWorkbook. ReadOnly = True Then 'only try to delete the file if the user has it locked Kill ThisWorkbook. The common piece to the randomness is file server 1 and why its not registering the excel session as an open session, which will then alert another user that it's already open.'Place these macros in your "ThisWorkbook" object Private Sub Workbook_BeforeClose ( Cancel As Boolean ) On Error Resume Next ' ignore possible errors If Not ActiveWorkbook. User2 closes excel, then user3 goes in and gets the lock message.

excel file locked for editing how to unlock

There are times where user1 will access a file, and user2 will wait a few minutes, go in and they do not see an lock message. And with that, those issues are not happening 100% of the time on file server 1. The app server doesn't seem to come into the equation, but file server 2 does not exhibit the same issues as file server 1. A open file session is never created for user2 on the file server, but they see and work as though all is normal.

excel file locked for editing how to unlock excel file locked for editing how to unlock

So they go in, make their changes, save out and close the file. user2 goes to open that same file, and does NOT get a message that the file is 'locked for editing' message. Situation: user1 opens up an excel file that is on server1 and starts to work. Current setup: 3 app servers (2008 r2, terminal services XenApp 6.5), 2 file servers (2008 r2).






Excel file locked for editing how to unlock