PDA

View Full Version : Solved: Save one sheet as Read-Only



debauch
02-22-2007, 08:30 AM
Hi there.

There is a list we use at work of 2000 or so users, and it is consistantly incorrect. I am working to create an interface to dummy-proof the process. All the excel sheets are hidden in the background and not accessible, unless you have admin rights to my app.

My question is, how can I create a copy of one of the tabs, and save it as read-only or password protected. What I want to do is: once they have made all the updates in the interface, save the one sheet so they cannot make any updates manually once they are ready to post the list. The below I was using to create a copy, but it leaves the opportunity to change data.

Sheets("BigList").Copy

Thoughts?

Bob Phillips
02-22-2007, 08:43 AM
How about hiding it



WorkSheets("BigList").Copy
With Activesheet
.Visible = xlSheetVeryhidden
End With

debauch
02-22-2007, 05:53 PM
Hey, thanks for the response.

The sheet actually hidden the begin with. The userform inputs the data onto the sheet. THis way, they cannot simpy drag things down, and input incorrect values.

When they are done making the updates using the userform , I want them to save the hidden sheet to the public drive. THing is, I can get it to copy to a seperate workbook, and save it as a name , but Im not sure how to make the new workbook have a password, or make it read-only. Is it possible?

Simon Lloyd
02-22-2007, 06:37 PM
Try this:

WorkSheets("BigList").Copy
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Simon\My Documents\Biglist.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=True, _
CreateBackup:=False
this saves it as read only without passwords to my documents, substitute Simon for your name.

Regards,
SImon

Simon Lloyd
02-22-2007, 09:14 PM
If you dont want to specify the path on your PC you could use this, it will save your sheet as a read only workbook to the path where the workbook is stored saving it as the worksheet name and todays date.

Sub SaveAndDate()
WorkSheets("BigList").Copy
ActiveWorkbook.SaveAs Filename:= _
ThisWorkbook.Path & "/" & ActiveSheet.Name & " " & Format(Date, "dd mmm yyyy"), FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=True, _
CreateBackup:=False
End Sub
Regards,
Simon

debauch
02-23-2007, 07:27 PM
That works great! Thank-you.

This way no-one will ever see the list unitl its read-only. sweeet!

debauch
02-26-2007, 10:23 AM
I actually found this worked best to p/w & read-only the new workbook.

ActiveSheet.Protect Password:="biglist07946"

Using that with Simon's save function did the trick.