Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make Excel file read only except for me

Status
Not open for further replies.

cboz

Technical User
Dec 24, 2002
42
US
how do i make a file read only for everyone else but me? Here is the code i used.

ActiveWorkbook.SaveAs "G:\Common\A A Never Out Reviews\" & Format(Date, "mmddyy") & ".xls", FileFormat:= _
xlExcel9795, Password:="", WriteResPassword:="", ReadOnlyRecommended:=True

if i put in a password then only i can open the file, if i used readonlyrecommended= true, then if you answer no to the open as read only question then you can make changes to the original file.
 
the clue is in the arguments: WriteResPassword:

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
that was the first thing i tried but when the user tried to open the file it did not give the option to open as read only. i must have done something else wrong because it is working now. thanks for your prompt reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top