PDA

View Full Version : [SOLVED:] error on Password User form by workbook Entry



Nikolausi
05-15-2020, 06:28 AM
Password User form by workbook Entry


Hi all,


i find a solution and so far works well, exept...a small failure :-)

:( error:
By open Workbook open Passwort User Form,
if i click on "Passwort ändern?" opens User Form 2.
If i change the passwort in User Form 2 and click to button, goes back to User Form 1
If in put in the new passwort comes error, even the passwort is corect.
If i put passwort second time, then goes to the next step and opens workbook.

where I make the error?

Workbook : https://www.transfernow.net/files/ddl/?utm_source=excel_PassUserForm_code&utm_content=de

Thx in Advance :bow:

Aussiebear
05-16-2020, 02:53 PM
Did you save the workbook after making the change?

Nikolausi
05-16-2020, 03:41 PM
Did you save the workbook after making the change?

Hi,

No I don't have it. But I want that it may not be necessary to save the folder, especially if the user wants to change the password at the beginning.

Can't do this in the code? ...with out to need save the workbook.


Thank you for taking the time to read and comment on my post.

Maybe you will get an idea how I could do this :-)

paulked
05-17-2020, 07:47 AM
It seems to me that you are looping through loops! When you enter the new password you are still in the loop that called the userform1, you don't leave the loop and so it brings back the userform a second time.

I would simplify the logic: Exit uf1 once a correct password has been entered. Have a button to show uf2 to change the password.

Nikolausi
05-17-2020, 09:07 AM
Hi paulked,

im very new with VBA...simply im a newbie :-)

How i can stop this Loop at the moment i but the right passwort in user form1 ? ....with out to stop the loop if the passwort wrong.

If you could send me a code how I could bypass this loop (as I said, without disturbing the loop with wrong password) it would help me a lot.
Seeing helps me more than I imagine :think:.

Thank you too for taking the time to read and comment on my post.

Nikolausi
05-17-2020, 10:41 AM
Hi paulked,

im very new with VBA...simply im a newbie :-)

How i can stop this Loop at the moment i but the right passwort in user form1 ? ....with out to stop the loop if the passwort wrong.

If you could send me a code how I could bypass this loop (as I said, without disturbing the loop with wrong password) it would help me a lot.
Seeing helps me more than I imagine :think:.

Thank you too for taking the time to read and comment on my post.


I also want to apologize to the administrator in this forum.
I also put my topic in another forum, without knowing that this could be a problem.
Have a friend explain to me why this can be a problem and understand.
Excuse me again and assure me that I will not do it again.

Nikolausi
05-17-2020, 10:46 AM
Same Question in other Forum


https://www.mrexcel.com/board/threads/problem-with-code-for-password-user-form-in-a-xlsm-workbook-entry.1134115/#post-5487793 (https://www.mrexcel.com/board/threads/problem-with-code-for-password-user-form-in-a-xlsm-workbook-entry.1134115/#post-5487793)


sry :sad2:

paulked
05-17-2020, 11:08 AM
Sorry, I haven't got a lot of time at the mo, but this is the idea:

Nikolausi
05-17-2020, 12:22 PM
Exaudi me, videt et gratias ago.
Facta, non verba.


Ego sum, Tibi debeo, gratias ago tibi.


A big thank you :-)

paulked
05-17-2020, 02:01 PM
Ti'n croeso, arhoswch yn ddiogel!
Gern geschehen! :thumb