Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

masking a password in excel 8

Status
Not open for further replies.

RFeniuk

Technical User
May 7, 2003
20
IN
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 <> &quot;password&quot; Then
MsgBox &quot;Incorrect password&quot;
Exit Sub
Else


What is the code to ask for a password and then replace the alpha values in the password with &quot;*&quot;. Can someone help me?
 
Check the properties of the object, there is a password character property that you can set to *

 
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? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
Chattin,

Great Link! [thumbsup2]

I had hoped that there was a way around this for &quot;simple&quot; password entry.

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

Again, Thanks! (
star.gif
) !




Peace! [peace]

Mike

Didn't get the answers that you wanted? Take a look at FAQ219-2884
 
I thought this was so good, I just had to bump it up to the top once. Sheck out Chattin's link!!!



[santa] Happy Ho Ho!!! [Cheers]

Mike

Didn't get the answers that you wanted? Take a look at FAQ219-2884
 
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
 
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 &quot;Star you baby one more time&quot;
That sites going straight onto my favourites

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
>>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 &quot;unless there's an API blah blah blah....&quot;

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? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
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 for great xl and xl/VBA help
 
Ivan,

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

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top