Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have used the following code to set up a simple inputbox for a user to enter a password in to access a report Dim PW As String PW = InputBox("Please enter the password") If PW = "THEPASSWORD" Then Else MsgBox "That's not correct" Cancel = True Exit Sub End If How can I add into this code something so that the inputbox uses the input mask for a password so it shows on screen as *****? -- Neil_Pattison ------------------------------------------------------------------------ Neil_Pattison's Profile: http://www.excelforum.com/member.php...o&userid=27696 View this thread: http://www.excelforum.com/showthread...hreadid=472890 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I was doing something similar but found that you could get around the
Password UserForm by clicking on the X on the upper right corner. It was suggested by someone that I use the following code to keep that from happening: Private Sub UserForm_QueryClose _ (Cancel As Integer, CloseMode As Integer) ' Prevents use of the Close button If CloseMode = vbFormControlMenu Then MsgBox "Clicking the Close button does not work." Cancel = True End If End Sub "dominicb" wrote in message ... Good morning Neil Pattison To do this you are probably better off using a textbox on a userform and set the PasswordChar property to "*". That is certainly the easier way. However, if you really want to continue using an input box, Daniel Klann has devised a way to get around the problem by using a series of API calls to intercept and translate the key presses. See his article he http://www.xcelfiles.com/API_09.html HTH DominicB -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=472890 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Password protection in macro ( Anybody can view my password in VB | Excel Discussion (Misc queries) | |||
Excel Data Protection- AKA: Sheet/Macro Password Protection | Setting up and Configuration of Excel | |||
Password Protection | Excel Discussion (Misc queries) | |||
Password Protection | Excel Discussion (Misc queries) | |||
password protection | Excel Programming |