?
Solved

Excel VBA Inputbox password

Posted on 2003-02-19
7
Medium Priority
?
1,229 Views
Last Modified: 2011-04-14
I have a condition that makes users opening the workbook put in their name, their title, then if they hold certain titles they get asked a password.  This all works perfect.  However to get the password I use a Inputbox.  It allows anyone to look over your shoulder and see what your password is, is there a way using the VBA to make that box scramble, or replace the char's with a single char so that is not visible. And I would like to have this run every time they type a letter.  That way it works just like password inputs on other programs.  And thanks.
0
Comment
Question by:rrhunt28
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 43

Accepted Solution

by:
Steve Knight earned 300 total points
ID: 7983801
You can use a user form.  Create a form and add a text box then you can set the PasswordChar property of the field to * say and it will just show a * for each character entered.

If you need help with this let us know.

Steve
0
 
LVL 5

Author Comment

by:rrhunt28
ID: 7987477
I will check that out and let you know man, thank you.
0
 
LVL 5

Author Comment

by:rrhunt28
ID: 7989249
Well, i figured that part out, and it makes sense to do it that way.  However I am still having a problem getting it to work this way.  I have one user form that asks for their title, then if that title is "Manger" it prompts for a password.  I tried doing this code with a seperate user form.  And now I am trying it using the same user form, but only having the password part be visible if the choice is "Manager".  I want it to only allow them to try the password 3 times before it exits excel.  
0
Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
LVL 43

Expert Comment

by:Steve Knight
ID: 7992461
OK, with EE emails down all over the place I've only just stumbled back across your feedback...

So you've got a form with username/password inputboxes.  Once a name is entered then if it is manager then presuambly you are seting the visible property of the password box to true in lostfocus etc. then do something similar in teh password box keeping a counter of tries (reset when you change teh user name.... and exit the app if you try too manyt imes.

Just going through a mound of EE emails now, will look back in a bit !

Steve
0
 
LVL 5

Author Comment

by:rrhunt28
ID: 7993626
Yes when value = "manager" i set the boxes to .visible
0
 
LVL 5

Author Comment

by:rrhunt28
ID: 7995815
I used your * in the input box, but I got the rest figured out, thank you for the help.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 7997895
Well thanks for the points anyway, sorry I hadn't helped more but when emails are down (and then come back up and leave us with hundreds...) there is such a delay between comments and feedback both ways things often end up getting sorted out so yourself I appreciate still awarding the points.

Glad to see you have it working now anyway.

Steve
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question