SandsB
Well-known Member
- Joined
- Feb 13, 2007
- Messages
- 705
- Office Version
- 365
- Platform
- Windows
I have a macro that does all kinds of magic. It's been working fine for years but I need to change it so the file it saves is password protected. I've tried a few things but no dice. Here's the code as is - what can I change to make it save with a password?
ActiveWorkbook.SaveAs Filename:="R:\MyFolder\MyFile.xlsx", CreateBackup:=False
ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly
ActiveWorkbook.SaveAs Filename:="R:\MyFolder\MyFile.xlsx", CreateBackup:=False
ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly