Public Property Get isWriteProtect(ByVal filename As String) As Boolean
    ' Leseeigenschaft definieren:
    Dim fs As New FileSystemObject
    If CheckFile(filename) Then
        Set File = fs.GetFile(filename)
        If (File.Attributes And 1) Then
            isWriteProtect = True
        Else
            isWriteProtect = False
        End If
    End If
End Property

Public Property Let isWriteProtect(ByVal filename As String, ByVal protect As Boolean)
    ' Schreibeigenschaft definieren
    Dim fs As New FileSystemObject
    If CheckFile(filename) Then
        Set File = fs.GetFile(filename)
        If protect Then
            File.Attributes = File.Attributes And Not 14000 Or 1
        Else
            File.Attributes = File.Attributes And Not 14001
        End If
    End If
End Property

Private Function CheckFile(filename) As Boolean
    ' prfen, ob eine Datei existiert
    Dim fs As New FileSystemObject
    If Not fs.FileExists(filename) Then
        Err.Raise vbObjectError + 2, "FileSystemTools", "Die Datei """ & filename & """ konnte nicht gefunden werden!"
        CheckFile = False
    Else
        CheckFile = True
    End If
End Function
