Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program/Macro to remove Hide/Unhide with password? ssciarrino Excel Programming 0 May 4th 07 05:36 PM
hide certain characters in a cell Julia Excel Discussion (Misc queries) 5 January 7th 07 12:19 AM
How do I hide a worksheet in Excel and use a password to un-hide . Dchung Excel Discussion (Misc queries) 3 December 2nd 04 06:24 AM
how to hide the characters in the cell oohss Excel Programming 2 September 15th 04 06:11 AM
Excel password but cant hide the sheets before entering password cakonopka[_3_] Excel Programming 1 January 30th 04 06:28 PM


All times are GMT +1. The time now is 03:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"