Based on this thread:
NewFilePath = PathNoExtension & "pdf" If Dir(NewFilePath) <> "" Then Dim res As Long res = GetAttr(NewFilePath) If res = 33 Then MsgBox "File is read only" Exit Sub End If End If