I have a userform that calls a function with username/password prompt.
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.
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.
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?
Here is my code so far:
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
...