Good morning RCollinge
This isn't possible using any native Excel commands but we could write
our own using the Before_Save event procedure. The code below will
happily let a workbook save without a password, however, after 1st Jan
next year a password (of "password") will be added - with no warning -
to the file when it is saved. However, there is a big but here. The
user must say "OK" to run macros when the file is opened - if the user
says no to the macro question the code will do nothing. And don't
forget that this code (as it uses event procedures) needs to go into
the ThisWorkbook pane of the VBE.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Application.DisplayAlerts = False
mydate = Now()
mydate2 = DateValue("January 1, 2006")
ActiveWorkbook.Save
If mydate mydate2 Then
ActiveWorkbook.SaveAs Filename:="C:\Book4.xls", Password:="password"
End If
Application.DisplayAlerts = False
End Sub
HTH
DominicB
--
dominicb
------------------------------------------------------------------------
dominicb's Profile:
http://www.excelforum.com/member.php...o&userid=18932
View this thread:
http://www.excelforum.com/showthread...hreadid=378922