i have a textbox on a worksheet that i only want to be visible if one successfully unprotects the sheet (password protected).
My code is shown below but i get an error when i try to run it - "method oleobjects of object _worksheet failed"

What could i be doing wrong?

Sub ShowClearAllButton()
    
    If wsDetail.ProtectContents = false Then
        wsDetail.OLEObjects("Textbox 9").Visible = True
        Else
        wsDetail.OLEObjects("TExtbox 9").Visible = False
    End If
End Sub





Thanks