writerespassword is not working


M

Moselle

below is my code. when i clock my macro button. it will automaticall
save my excel sheet but i can only open it with password. whenever i tr
to open it with my wrirespassword. it just prompt the CAPS LOCKs error
im new to excel and i totally have no idea why this happen when th
password works well as i need to open it in writeable version wit
wrirespassword. if i remove the password:= and just used th
wrirespassword. it will auto save as open excel without encryp
anything. please help me on this :(


Sub SaveInvWithNewName()
Dim NewFN As String
' Copy Invoice to a new workbook
ActiveSheet.Unprotect 111
ActiveSheet.Copy
NewFN = "Users/cs/Desktop" & Range("E3").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat _
:=xlNormal, Password:="222", WriteResPassword:="333", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
NextInvoice
ActiveSheet.Protect 111

End Su
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top