troubleshooting Question

Save file over existing file with password

Avatar of Jagwarman
Jagwarman asked on
Microsoft Excel
8 Comments1 Solution95 ViewsLast Modified:
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", _
        ReadOnlyRecommended:=True, CreateBackup:=False

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.
Rob Henson
Finance Analyst

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros