Pobo
Mar 26th, 2006, 01:06 PM
Hi
Can anyone tell me the best way to automate the saving of a file as read only and to protect the worksheet so that cells cannot be edited or copied.
At the moment I am using the following code:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlNoSelection
Range("B7").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Administrator\My Documents\Book2.xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False
ActiveWorkbook.Close
But when you reopen the workbook the cells cannot be edited but the dis-'EnableSelection' setting seems to have been reset and users are able to select cells again.!!!!??
Has anyone got any suggestions please?
Many thanks
Pobo
Can anyone tell me the best way to automate the saving of a file as read only and to protect the worksheet so that cells cannot be edited or copied.
At the moment I am using the following code:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlNoSelection
Range("B7").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Administrator\My Documents\Book2.xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False
ActiveWorkbook.Close
But when you reopen the workbook the cells cannot be edited but the dis-'EnableSelection' setting seems to have been reset and users are able to select cells again.!!!!??
Has anyone got any suggestions please?
Many thanks
Pobo