title: How to make userform in Excel VBA remember password when 'red x' is pressed
body: <p>I have a userform that calls a function with username/password prompt.</p>
  
  <p>The user usually has to run it more times and each time is prompted for the login credentials so I want the userform to remember the user/password once it has been given until the workbook has been closed. </p>
  
  <p>It is working fine until the user presses the 'process' button or closes the userform from the 'close' button, but when he/she closes it with the 'red x', the user/pass disappears on the next run.</p>
  
  <p>I know that the 'red x' can be disabled, but I am curious if there is another way to make the userform remember even when the 'red x' is pressed?</p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>Private Sub cbCancel_Click()
  maplogin.Hide
  End Sub
  
  Sub cbProcess_Click()
  
  Dim drivetomap As String
  Static user As String
  Static pass As String
  
  pcname = ActiveCell.Value
  user = Me.txtUser.Value
  pass = Me.txtPass.Value
  ...
  </code></pre>