rjplante
Well-known Member
- Joined
- Oct 31, 2008
- Messages
- 574
- Office Version
- 365
- Platform
- Windows
I have the following code that I have to restrict access to the VBA window and when the user requests access an input box appears for the user to enter the correct password. The only problem is that when you enter the password, you can see the actual text. Is there a way to have a generic symbol such as an asterisk or an X appear as the user enters the password in the input box window?
Thanks for the help,
Robert
================================
Thanks for the help,
Robert
================================
Code:
Sub Access_VBA_Editor()
If Sheets("Intro Page").Range("T15").Value = "RJP" Then
Dim strResp As String
strResp = InputBox("Enter password to access VBA editor", "Password")
If strResp = "ABC" Then
Application.ScreenUpdating = True
Application.OnKey "%{F11}" 'Key press Alt+F11
Application.SendKeys "%{F11}" 'Key press Alt+F11
Else
MsgBox "Invalid Password - VBA access is denied"
End If
Else
Exit Sub
End If
End Sub