How can I make it none?

sudbhavani

New Member
Joined
May 22, 2017
Messages
6
I am making excel with expiry date with password and it’s works fine. Now, my question is while I am entering password text box in excel it shows text, I want make password visible none. How can I make it none?
but I have created that password box using below code. so, how can i make none using below code?
Code:
[COLOR=#333333]Private Sub WorkBook_Open()[/COLOR]
Dim edate As Date, mbox As Variant, myuser As String, wbuser As String

Application.ScreenUpdating = False
edate = DateSerial(2017, 10, 22)

If Date > edate Then
    MsgBox "Oops! Test/Evaluation period of the utility has been expired." & vbCrLf & _
            "Pls ask the concern person to get the updated utility.", vbCritical, "Outdated/Expired Version"
    mbox = Application.InputBox("Pls input the password/code to continue...", "Password")
        If mbox <> "ABCD" Then ThisWorkbook.Close False
    End If
    End Sub
    
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    With Me.TextBox1
        If .Text <> strPass Then
            TextBox1.ForeColor = &H80000008& '<~~ Set to Black
            TextBox1.PasswordChar = "**" '<~~ Set password Char
        End If
    End With
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
With Application
.CellDragAndDrop = True
.OnKey "^c"
.OnKey "^v"
.OnKey "^x"
.OnKey "+{DEL}"
.OnKey "^{INSERT}"
.CutCopyMode = False
End With
Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=19) 'copy
    Ctrl.Enabled = True
Next Ctrl
For Each Ctrl In Application.CommandBars.FindControls(ID:=21) ' Cut
    Ctrl.Enabled = True
Next Ctrl
For Each Ctrl In Application.CommandBars.FindControls(ID:=22) ' Paste
    Ctrl.Enabled = True
Next Ctrl
For Each Ctrl In Application.CommandBars.FindControls(ID:=755) ' Paste Special
    Ctrl.Enabled = True
Next Ctrl
    On Error Resume Next
    With Application
    .CutCopyMode = False
    .CellDragAndDrop = False
    .OnKey "^c", ""
    .OnKey "^v", ""
    .OnKey "^x", ""
    .OnKey "+{DEL}", ""
    .OnKey "^{INSERT}", ""
    End With
   
    For Each Ctrl In Application.CommandBars.FindControls(ID:=19) ' Copy
        Ctrl.Enabled = False
    Next Ctrl
    For Each Ctrl In Application.CommandBars.FindControls(ID:=21) ' Cut
        Ctrl.Enabled = False
    Next Ctrl
    For Each Ctrl In Application.CommandBars.FindControls(ID:=22) ' Paste
        Ctrl.Enabled = False
    Next Ctrl
    For Each Ctrl In Application.CommandBars.FindControls(ID:=755) ' Paste Special
        Ctrl.Enabled = False
    Next Ctrl
    
    End Sub

Private Sub Workbook_Activate()
    On Error Resume Next
    With Application
    .CutCopyMode = False
    .CellDragAndDrop = False
    .OnKey "^c", ""
    .OnKey "^v", ""
    .OnKey "^x", ""
    .OnKey "+{DEL}", ""
    .OnKey "^{INSERT}", ""
    End With
    Dim Ctrl As Office.CommandBarControl
    For Each Ctrl In Application.CommandBars.FindControls(ID:=19) ' Copy
        Ctrl.Enabled = False
    Next Ctrl
    For Each Ctrl In Application.CommandBars.FindControls(ID:=21) ' Cut
        Ctrl.Enabled = False
    Next Ctrl
    For Each Ctrl In Application.CommandBars.FindControls(ID:=22) ' Paste
        Ctrl.Enabled = False
    Next Ctrl
    For Each Ctrl In Application.CommandBars.FindControls(ID:=755) ' Paste Special
        Ctrl.Enabled = False
    Next Ctrl
    
    
End Sub
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Cancel = True
MsgBox "Right click menu deactivated." & vbCrLf & _
"For this file:", 16, ""
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
     Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    
    On Error Resume Next
    With Application
    .CutCopyMode = False
    .CellDragAndDrop = False
    .OnKey "^c", ""
    .OnKey "^v", ""
    .OnKey "^x", ""
    .OnKey "+{DEL}", ""
    .OnKey "^{INSERT}", ""
    End With
    Dim Ctrl As Office.CommandBarControl
    For Each Ctrl In Application.CommandBars.FindControls(ID:=19) ' Copy
        Ctrl.Enabled = False
    Next Ctrl
    For Each Ctrl In Application.CommandBars.FindControls(ID:=21) ' Cut
        Ctrl.Enabled = False
    Next Ctrl
    For Each Ctrl In Application.CommandBars.FindControls(ID:=22) ' Paste
        Ctrl.Enabled = False
    Next Ctrl
    For Each Ctrl In Application.CommandBars.FindControls(ID:=755) ' Paste Special
        Ctrl.Enabled = False
    Next Ctrl
    
End Sub
On Error Resume Next
With Application
.CellDragAndDrop = True
.OnKey "^c"
.OnKey "^v"
.OnKey "^x"
.OnKey "+{DEL}"
.OnKey "^{INSERT}"
.CutCopyMode = False
End With
Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=19) ' Copy
    Ctrl.Enabled = True
Next Ctrl
For Each Ctrl In Application.CommandBars.FindControls(ID:=21) ' Cut
    Ctrl.Enabled = True
Next Ctrl
For Each Ctrl In Application.CommandBars.FindControls(ID:=22) ' Paste
    Ctrl.Enabled = True
Next Ctrl
For Each Ctrl In Application.CommandBars.FindControls(ID:=755) ' Paste Special
    Ctrl.Enabled = True
Next Ctrl
End If [COLOR=#333333]End Sub[/COLOR]
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Please take a minute to read the forum rules, especially regarding cross-posting, and then update this thread to include links to any and all cross-posts in other forums. Thank you.
 
Upvote 0

Forum statistics

Threads
1,214,403
Messages
6,119,308
Members
448,886
Latest member
GBCTeacher

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