excel file showing in use, when it is not
-
Wednesday, May 02, 2012 7:56 AMI openend an excel file to check if any work had been done on it - there was none, so I closed the file [without saving it] ... now the file shows that it was modified on at that time, which it should not ... and most importantly it reads that my logon has locked the file and is now only available as "read only" .... how can this be unlocked, so that it is again accessible to other users and myself .... {I have since then been logged off and closed down completely - no change in status or message}
All Replies
-
Wednesday, May 02, 2012 12:47 PM
Try to check by this VBA function:
Function IsFileOpen(FileName As String) Dim iFilenum As Long Dim iErr As Long On Error Resume Next iFilenum = FreeFile() Open FileName For Input Lock Read As #iFilenum Close iFilenum iErr = Err On Error GoTo 0 Select Case iErr Case 0: IsFileOpen = False Case 70: IsFileOpen = True Case Else: Error iErr End Select End Function sub test() 'run this procedure msgbox "Your file is open: " & IsFileOpen("c:\filePath\File.xls") '<- change your path end sub
Oskar Shon, Office System MVP
Press
if Helpful; Answer when a problem solved- Marked As Answer by Rex ZhangModerator Thursday, May 10, 2012 5:56 AM
-
Tuesday, May 08, 2012 3:05 PM

