Once the file is opened, you can protect the sheet with code like the following:
Sub ProtectSheetClients()
Dim wb As Workbook
'Set the workbook to the Workbook containing the file you want to protect
Set wb = ActiveWorkbook
'Use code like one of the following to protect the sheet
'Use the Macro Recorder if you need different options
wb.Sheets("Clients").Protect
wb.Sheets("Clients").Protect Password:="foo"
wb.Sheets("Clients").Protect DrawingObjects:=False, Contents:=True, Scenarios:=False
wb.Sheets("Clients").Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFormattingCells:=True
End Sub
Lewis
Bookmarks