+ Reply to Thread
Results 1 to 10 of 10

InputBox with Masked Password

  1. #1
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    InputBox with Masked Password

    Hi guys,

    If it is not too much of an inconvenience to ask, can someone assist me with the below.

    Basically I have this code, which requires a password in order to unhide a specific sheet, called 'Home'.

    Please Login or Register  to view this content.
    Not sure if possible with an input box, but would it be possible to amend the code so as it masks the password as it is entered?

    Appreciate a lot your kind help!!!

    Thanks

    Keibri
    Last edited by AliGW; 05-18-2020 at 01:29 AM.

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: InputBox with Masked Password !

    It's not possible to mask input in a standard input box. You can design a custom userform as an ActiveX textbox does have the ability to mask unput. This is by far the simplest method and there are plenty is examples around the place (Using a phone so no direct links to examples).

    It is possible to use the Windows API to hook input to an InputBox but this is complicated and requires coding for 32 or 64 bit systems.

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: InputBox with Masked Password !

    Hello Keibri
    This sample file may help you in this issue
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  4. #4
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Re: InputBox with Masked Password !

    Thanks for the suggestion cytop

    Yasser., sorry to bother, I tried to run the macro but gave me the following error:

    Run time error '-2147024809 Invalid procedure call argument'.

    Not sure exactly why.

    Thanks for your help!

    Keibri

  5. #5
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: InputBox with Masked Password !

    Other one, with same color for textbox textinput as backcolor

    Please Login or Register  to view this content.
    Kind regards
    Leo
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: InputBox with Masked Password !

    Or.....build yourself an excel userform in the editor and set the property 'PasswordChar' of the text box users will type their passwords into to '*'.

    Then you've got a starred out text input box. It's that simple.

    https://support.microsoft.com/en-gb/kb/830258

  7. #7
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: InputBox with Masked Password !

    Hello Keibri,

    Here is another alternative:

    In a Standard Module;

    Please Login or Register  to view this content.
    In ThisWorkbook Code;

    Please Login or Register  to view this content.
    UserForm Code:

    Please Login or Register  to view this content.
    Try the attached sample Workbook.

    Regards.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  8. #8
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Re: InputBox with Masked Password !

    Guys ! Thanks everyone for your input! Really thanks!

    I tested the one provided by WInon and it worked perfectly how I had in mind!! Thanks a lot man!!

    Thanks

    Keibri!!

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: InputBox with Masked Password !

    Hello Keibri,

    You are welcome, glad I could help. Also thank you for the Rep, it is much appreciated!

    Regards.

  10. #10
    Registered User
    Join Date
    05-18-2020
    Location
    Caracas, VE
    MS-Off Ver
    2016
    Posts
    1

    Re: InputBox with Masked Password !

    Hello guys,

    I'm new here, I was looking for the same answer and I got this in Stack Overflow, it has a different approach on solving the issue, it uses the kernel API to get to the InputBox and then mask the input, I hope this would be useful to you as well.

    Please Login or Register  to view this content.
    Then to invoke the masked InputBox, use the function InputBoxDK(Prompt, Title)

    example:

    Please Login or Register  to view this content.

+ 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. *** mask password in inputbox
    By Kvracing in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-05-2015, 08:16 PM
  2. *** mask password in inputbox
    By Kvracing in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2014, 07:55 PM
  3. [SOLVED] Masked characters Inputbox
    By graphicgoose in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2014, 09:52 PM
  4. [SOLVED] VBA InputBox Password Validation
    By mcmunoz in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-05-2013, 10:25 PM
  5. Asterix when password entered into InputBox
    By adste89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-29-2012, 10:59 AM
  6. How to code Inputbox in password format
    By SMILE in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2011, 07:50 AM
  7. InputBox Password
    By noodle48 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-28-2011, 08:18 AM

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