how to protect excel work sheet with visual basic?
the macro code of protection is:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
how to transform it to visual basic code?
PS: I open excel with the following code:
Set objExcel = GetObject(Source)
objExcel.Application.Visible = True
objExcel.windows(1).Visible = True
objExcel.sheets(1).cells(1, 1).Value = "hihi"
........ after that I want to protect the workbook