Programming Reference Manual
 
Syntax
 
SetAttr Name$, Attrib
 
Description
Set the attributes for file Name$. If the file does not exist then a run-time error occurs.
 
Parameter
Description
Name$
This string value is the path and name of the source file. A path relative to the current directory can be used. 
Attrib 
Set the file's attributes to this numeric value.
 
A file attribute is zero or more of the following values added together.
Attribute
Value
Description
vbNormal
0
Normal file.
vbReadOnly
1
Read-only file.
vbHidden
2
Hidden file.
vbSystem
4
System file.
vbVolume
8
Volume label.
vbDirectory
16
MS-DOS directory.
vbArchive
32
File has changes since last backup.
See Also
 
Example
 
Sub Main
    Attrib = GetAttr("XXX")
    SetAttr "XXX",1 ' readonly
    Debug.Print GetAttr("XXX") ' 1
    SetAttr "XXX",Attrib
End Sub