Function LockFile(strFileName) set fso = CreateObject("Scripting.FileSystemObject") set f = fso.GetFile(strFileName) if f.attributes <> 7 then f.attributes = 7 end if End Function Function UnLockFile(strFileName) set fso = CreateObject("Scripting.FileSystemObject") set f = fso.GetFile(strFileName) if f.attributes = 7 then f.attributes = 1 end if End Function