SaveAs Method and sheet protection

  • Thread starter Thread starter BrianG
  • Start date Start date
B

BrianG

If I us the SaveAs Method from within and Excell 97 macro should the
sheet protection status follow be maintained in the saved file? I get
the impression from the help file that it should but tests don't bear
that out.
 
Using the following code, my tests showed that protection followed.

ActiveWorkbook.SaveAs Filename:= _
"C:\temp\test.xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=False

However, you can always add protection through code using:

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
 
Back
Top