title: "Block If without End If" error
body: <p>I'm getting a compile error for this code:</p>
  
  <pre><code>Public Sub CommandButton1_Click()
  If TextBox1.Text = "log off" Then
  Shell "cmd.exe /c shutdown -l", vbHide: TextBox2.Text = "Logging off"
  If TextBox1.Text = "shutdown" Then
  Shell "cmd.exe /c shutdown -s", vbHide: TextBox2.Text = "Shutting Down"
  If TextBox1.Text = "restart" Then
  Shell "cmd.exe /c shutdown -r", vbHide: TextBox2.Text = "Restarting"
  
  Else
  MsgBox "Command Not Defined",vbCritical
  End Sub
  </code></pre>
  
  <p>Now it comes up with this Error Message of "Block If without End If".
  Why?</p>