How to protect worksheet using com object

I am looking to programmatically set the protect worksheet and set password. If anyone can give me a few pointers.

See subroutines ProtectSheets() and UnprotectSheets() in standard library Tools module Misc.

Methods .Protect() and .Unprotect() of object Sheet has one parameter as String.

Works Perfectly. Cheers. John sun

Written In
not complete code

    Dim oSM As Object = CreateObject("")
    Dim oMM As Object = oSM.createInstance("")
    Private WorkSheet As Object
    Dim OpenPar(1) As Object
    OpenPar(0) = MakePropertyValue("Hidden", True)
    Spreadsheet = oMM.LoadComponentFromUrl("file:///'Location'/" & SpreadSheetName, "_blank", 0, OpenPar)
    WorkSheet = Spreadsheet.Sheets.getByName(WorkSheetName)

       'Do something with worksheet'

     Dim arg(-1) As Object
    Spreadsheet.storetoURL("file:///'Location'/" & SaveName, arg)
 Function MakePropertyValue(cName, uValue) As Object
    Dim oPropertyValue As Object
    Dim oSM As Object
    oSM = CreateObject("")
    oPropertyValue = oSM.Bridge_GetStruct("")
    oPropertyValue.Name = cName
    oPropertyValue.Value = uValue
    MakePropertyValue = oPropertyValue
End Function