×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

masking a password in excel
8

masking a password in excel

masking a password in excel

(OP)
What I have is control button that runs some code in Excel when it is clicked.  I want to have a text box pop up that asks for a password before the code is run.  

I have the following code in right now but when I type the password it shows the password.

mPass = InputBox("Please enter password to run macro")
If mPass <> "password" Then
  MsgBox "Incorrect password"
  Exit Sub
Else


What is the code to ask for a password and then replace the alpha values in the password with "*".  Can someone help me?

RE: masking a password in excel

Check the properties of the object, there is a password character property that you can set to *

RE: masking a password in excel

The property is PasswordChar and belongs to a textbox object.  The moral of the story is that you can't do it with an input box so create you need to create a form with a text box and set the passwordchar property to anything you like.

If a man says something and there are no women there to hear him, is he still wrong?
The faqs ma'am, just the faqs.  Get the best from these forums : FAQ222-2244

RE: masking a password in excel



Chattin,

Great Link!

I had hoped that there was a way around this for "simple" password entry.

You might want to start a FAQ that contains the Links to Daniel Klann's web page.

Again, Thanks! () !


Peace!

Mike

Didn't get the answers that you wanted? Take a look at FAQ219-2884

RE: masking a password in excel

I thought this was so good, I just had to bump it up to the top once.  Sheck out Chattin's link!!!

Happy Ho Ho!!!

Mike

Didn't get the answers that you wanted? Take a look at FAQ219-2884

RE: masking a password in excel

Chattin,

Love the link, I especially liked the refference for making the spreadsheet require macros to be enabled.  I will be changing some of my sheets to include this.

gizzy

RE: masking a password in excel

mmmmmmm - API calls. I seem to recall there's a similar one around somewhere for customising msgbox button text and colours. Nice link though Chattin - please allow me to "Star you baby one more time"
That sites going straight onto my favourites

Rgds, Geoff
Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes!
Want the best answers to your questions ? FAQ222-2244

RE: masking a password in excel

>>The moral of the story is that you can't do it with an input box

I knew as I wrote it that I'd be proven wrong so nearly added "unless there's an API blah blah blah...."

Anyway, excellent link and like xlbo, it's now added to favourites.  Although I could always try to remember the code for future reference.  Mmmmmmmmmmmmmmm?

PPP from me too!

If a man says something and there are no women there to hear him, is he still wrong?
The faqs ma'am, just the faqs.  Get the best from these forums : FAQ222-2244

RE: masking a password in excel

Cheers for the stars but you should give dk the credit really - if you need to contact him: dan@danielklann.com

Glad the link was useful to you all.

Happy Christmas!
Gelukke Kerst!
Joyeaux Noel!

Chris

Visit http://www.mrexcel.com/board/index.php for great xl and xl/VBA help

RE: masking a password in excel

Ivan,
   
   Since I've been guilty of "shooting the messenger", I guess I can be be guilty of rewarding the messenger too. Have another star.

Steve

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close