title: Workbook to close if passwords were incorrect
body: <p>In case a user enters a worng password I want the workbook to close down without saving. However, the code I'm trying does not work. </p>
  
  <pre><code>Sub Unhide()
  
  mypass = Application.InputBox( _
  prompt:="Enter password - In case of wrong password please close the file 
  and try again")
  
  
  If mypass = "BJE" Then Sheets("Overview").Visible = True
  If mypass = "BFL" Then Sheets("BFL").Visible = True
  If mypass = "EBR" Then Sheets("EBR").Visible = True
  If mypass = "DME" Then Sheets("DME").Visible = True
  If mypass = "AJA" Then Sheets("AJA").Visible = True
  If mypass = "RLC" Then Sheets("RLC").Visible = True
  If mypass = "JMK" Then Sheets("JMK").Visible = True
  If mypass = "AXB" Then Sheets("AXB").Visible = True
  If mypass = "JIK" Then Sheets("JIK").Visible = True
  If mypass = "KKO" Then Sheets("KKO").Visible = True
  
  If mypass &lt;&gt; "BJE" Or "BFL" Or "EBR" Or "DME" Or "AJA" Or "RLC" Or "JMK" 
  Or "AXB" Or "JIK" Or "KKO" Then ThisWorkbook.Close
  
  
  End Sub
  </code></pre>