Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 2
Default writerespassword is not working

below is my code. when i clock my macro button. it will automatically save my excel sheet but i can only open it with password. whenever i try 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 the password works well as i need to open it in writeable version with wrirespassword. if i remove the password:= and just used the wrirespassword. it will auto save as open excel without encrypt 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 Sub
  #2   Report Post  
Junior Member
 
Posts: 2
Cool

ok!! i did it somehow loll~
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Query working on some computer, and not working on others?!? Charlotte E[_2_] Excel Programming 1 August 18th 10 01:20 PM
WriteResPassword Graham35p Excel Programming 4 July 9th 09 02:48 PM
WriteResPassword... Sam Excel Programming 0 April 28th 09 05:27 PM
Calculate working days but change working week SamB Excel Discussion (Misc queries) 1 September 1st 08 09:17 PM
Setting Password & WriteResPassword Kevin H. Stecyk[_2_] Excel Programming 0 January 27th 05 03:16 AM


All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"