Try it this way (substituting your actual password for the "test" one I
used)...
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
With Worksheets("Sheet1")
.Unprotect "test"
.Range("Celled").Value = Now()
.Protect "test"
End With
End Sub
You might have to play around with the optional arguments for the Protect
method (see the help files) in order to customize the level of protection.
Rick
>I have used a visual basic routine to save the date and time when I save an
>Excel file.
[quoted text clipped - 26 lines]
> security problems. The tools are there to protect the files, the end
> users are just not using them properly.
ChuckN - 05 Apr 2008 19:36 GMT
Good thought, but it still does not work. When I removed the password
protection for accessing the file, it did work. When I added the password
protection to open the file and saved the file, it continued working until I
closed the file. When I reopened the file using the password, it stopped
working.
> Try it this way (substituting your actual password for the "test" one I
> used)...
[quoted text clipped - 43 lines]
>> are security problems. The tools are there to protect the files, the end
>> users are just not using them properly.