Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Macro Password Characters
I have the following code:
If InputBox("To run update, please enter the password:") < "password" Then Exit Sub What is the code to get the password to display as ******** as they type? Thanks, Jacob |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Macro Password Characters
Hi Jacob
It can only be done in an userform. Create an userform with a Textbox and two buttons ( OK/Cancel). Select the Textbox and open the Properties window (F4) and find the PasswordChar property and enter * in the filed next to it. Hopes this helps. .... Per On 20 Aug., 02:04, Morgimo wrote: I have the following code: If InputBox("To run update, please enter the password:") < "password" Then Exit Sub What is the code to get the password to display as ******** as they type? Thanks, Jacob |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Macro Password Characters
Jacob,
A few years ago I found a solution for this dilemma on one of the many Excel message boards So here it goes: The inputbox is a native component and can't be modified insomuch as you describe. However if you make your own form you can use a textbox instead and set the textbox to have an inputmask. For the new form in VB6 or newer you can set the passwordchar property to * First in your code you have to replace: YourPassword = InputBox("Please enter your password") with YourPassword = frmPass.Raise Then in the new password form code: -------------------------------------------------------------- Option Explicit Dim strPassword As String Private Sub cmdOkay_Click() strPassword = txtPass.Value Me.Hide End Sub Public Function Raise() As String Me.Show vbModal Raise = strPassword End Function -------------------------------------------------------------- Note that cmdOkay is the name of the Okay button on the password box, txtPass is the name of the textbox you enter the password in and frmPass is the name of the password form. Hope this helps you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Program/Macro to remove Hide/Unhide with password? | Excel Programming | |||
hide certain characters in a cell | Excel Discussion (Misc queries) | |||
How do I hide a worksheet in Excel and use a password to un-hide . | Excel Discussion (Misc queries) | |||
how to hide the characters in the cell | Excel Programming | |||
Excel password but cant hide the sheets before entering password | Excel Programming |