title: Hide or disable a button if the sheet is protected
body: <p>For my form I need to hide or disable a textbox with a on-click delete macro attached to it when the sheet is protected. I'm talking about excel's build-in  protection system. I've looked at several tutorials but I can't seem to get it to work properly.
  I tried multiple things including this:</p>
  
  <pre><code>If ActiveSheet.ProtectContents = True Then
      TextBox1.Visible = False
  Else
      TextBox1.Visible = True
  End If
  </code></pre>
  
  <p>Any idea how to do this?</p>