Input box for password

rjplante

Well-known Member
Joined
Oct 31, 2008
Messages
574
Office Version
  1. 365
Platform
  1. 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

================================

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
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,224,584
Messages
6,179,693
Members
452,938
Latest member
babeneker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top