If you know the password why can't you use it in the code when you want to open the workbook?
strPass = TextBox1.Value
What userform?
Are you entering the password on a userform and clicking a button to open the workbook?
Or something like this.
If you are it's pretty straightforward to get the password if it's been entered in a textbox or similar.
It would just be something like this, where TextBox1 is where the password has been entered.
Note - the userform would still need to be loaded for that to work.Code:strPass = TextBox1.Value