Save file over existing file with password
Posted on 2014-12-05
I use the below code to save a file with a date and a password
ActiveWorkbook.SaveAs Filename:="\\ukancbdata02\S-gdata\AllFiles\Recon\London\Events\Consolidated Report\Consolidated " & Format(DateAdd("d", -0, Date), "YYYY") & ".xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="pact", _
What I need to do do is overwrite the file each day but because it is password protected the code returns an error.
Could an Expert provide me with the code that will enable me to save the file each day over the existing file with the password.