+ Reply to Thread
Results 1 to 5 of 5

Mask the password with *** (asterisk)

  1. #1
    Registered User
    Join Date
    03-24-2010
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    50

    Mask the password with *** (asterisk)

    Hi

    I have this code I use for hiding several sheets:

    Please Login or Register  to view this content.
    screenshot.1.jpg

    when I write password in confirmation dialog it can be seen, is there a code where I could mask it with *** (asterisk)?
    tnx

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Mask the password with *** (asterisk)

    It can be done using some API calls but it is simpler to use a userform with a textbox since that has a PasswordChar property that you can use to mask the input.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Mask the password with *** (asterisk)

    Good morning perko121

    xlnitwit's quite correct - it's much easier to create a userform and do it that way. But just for completeness, here's how it's done using API calls (with all due credit to Daniel Klann and Ivan F Moala).
    way
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-24-2010
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Mask the password with *** (asterisk)

    Thank you,

    how is it done with userform, I would like to test it maybe it will be better option for me?

    What I need is password prompt form each time document is opened that would show visible sheets if password is correct, if pressed "cancel" it will open only sheets that are not password protected.

  5. #5
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Mask the password with *** (asterisk)

    Hi perko121

    From the VBE got to Insert > UserForm.

    Draw a textbox (make sure it's called TextBox1) and a command button (CommandButton1).

    Right click and select "View Code" to open the pane where the code that drives the form can sit and copy this into it :
    Please Login or Register  to view this content.
    Call the userform from another module using :
    Please Login or Register  to view this content.
    HTH

    DominicB

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to mask the password using this code
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 09-01-2017, 12:16 PM
  2. Numbers before 1st asterisk, 2nd asterisk, 3rd asterisk
    By stephme55 in forum Excel General
    Replies: 1
    Last Post: 08-23-2016, 12:57 AM
  3. Using an asterisk
    By NDmad in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-20-2016, 05:14 PM
  4. How to Mask Password in MsgBox ???
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-06-2016, 09:38 PM
  5. *** mask password in inputbox
    By Kvracing in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-05-2015, 08:16 PM
  6. *** mask password in inputbox
    By Kvracing in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2014, 07:55 PM
  7. Hide/Mask Cell Data Unless Password Entered
    By JimmyG. in forum Excel General
    Replies: 1
    Last Post: 06-28-2014, 04:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1