Read only without password
I'm not sure if there's a way to make a file read only in Excel, but you can do it with the FileSystemObject of the Scripting library. Try the following procedure
Sub MakeReadyOnly(strFile As String
' strFile should resemble c:\Book1.xl
Dim fso As Objec
Dim file As Objec
Set fso = CreateObject("Scripting.FileSystemObject"
Set f = fso.GetFile(strFile
f.Attributes = 1 ' 1 is read only. 32 is archive. 32 + 1 is 33 for Archive and ReadOnl
Set fso = Nothin
Set f = Nothin
End Su
-Brad Vontur
|