leekf
asked on
vb code to protect excel worksheet
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.Visib le = True
objExcel.windows(1).Visibl e = True
objExcel.sheets(1).cells(1 , 1).Value = "hihi"
........ after that I want to protect the workbook
Thanks
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.Visib
objExcel.windows(1).Visibl
objExcel.sheets(1).cells(1
........ after that I want to protect the workbook
Thanks
ASKER
thanks
but i cannot set the password to protect
Could you tell me how to do that?
but i cannot set the password to protect
Could you tell me how to do that?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
?