ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   password protect on workbook (https://www.excelbanter.com/excel-programming/288437-password-protect-workbook.html)

Jo[_6_]

password protect on workbook
 
Hi
I am trying to save a file that requires a passowrd not
for opening , but only for opening and saving.
I would like password to be false and WriteResPassword
true.
The below code is not working for me.
Thanks
Jo
Password Optional Variant. A case-sensitive string (no
more than 15 characters) that indicates the protection
password to be given to the file.
WriteResPassword Optional Variant. A string that
indicates the write-reservation password for this file. If
a file is saved with the password and the password isn't
supplied when the file is opened, the file is opened as
read-only.

Sub save()
ActiveWorkbook.SaveAs "jo", xlNormal, , "anne"
End Sub

Jim Rech

password protect on workbook
 
Your code works perfectly for me as is. How is it failing for you?

--
Jim Rech
Excel MVP




All times are GMT +1. The time now is 04:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com