+ Reply to Thread
Results 1 to 16 of 16

Input Box Prompt for password

  1. #1
    Forum Contributor
    Join Date
    09-22-2007
    Posts
    119

    Input Box Prompt for password

    Hi , How The Vba Code Used For

    My Excel File Name "eai.xls" ,when I Click The File , It Open The Sheet Name "menu" With The Inputbox Prompt:="put Your Id"
    When The User Put The True Id , It Will Show The Input Box Prompt:="your Password" . If The Password True Will Activate The Sheet Name "data" .and Hide All The Menu Bar.

    If The Wrong Id Name Show The Msg.box "re Enter Your True Id " ,that Also For The Wrong Password In Which If User Put More Than 3 Times Wrong , Will Close The Workbook And Exit File.

    The User Persons Allow 10 Person Id . Keep In The Table Of The Sheet Name " Id And Password" The Id No. Are In The A1:a10
    Password No. Are In B1:b10
    This Sheet Name Is Hide And Protect

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Not sure if I follow you correctly, but this might help
    Attached Files Attached Files
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    09-22-2007
    Posts
    119

    more help for the answer

    thank,for your help and your good example.
    but i have more problem..for you help.
    1.when input the correct username and password ,why..? it showed msg."sorry,you must enter password "
    can change code for not to show this msg. when input the correct uersname and password..
    2.you set the user="Manager" and password ="secret " can you change the code for username more than 1 person using the excel file such as 10 person ex. . "Mr.a ,Mr.b ,Mr.c ,....... and the password ...password1,password2,password3.......in your code
    3.can you modify for the user to change the username and password by themself ??
    4.can you hide all menu of excel sheet must not show after the user key correct username and password
    Last edited by pichai; 12-07-2007 at 10:12 AM.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I have re-written the code and included an examle of using multiple users with different passwords - see the Multi User Button.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    09-22-2007
    Posts
    119

    New Queution

    Thans So Much ,Roy Uk
    May Be I Have The Wrong Queution ,I Have The Ex .For You Help Me Again
    1.I Have The Excel File , I Want To Set About 15 Users
    With Usersname And Password In The Table Of"Sheet Username And Password Control The First Use In Part 1 . All Users Can Change The Passsword" By Themself . The New Password Will Replace In The Old Password -Look As Ex.File Sheet "Username And Password Control"

    1.2 When The User Click The File . It Popup Login In Sheet "Main "
    If The Correct Username And Password . The Sheet "Main "Is Hidden And The Sheet Menu Is Show And The Menu Bar In The Sheet Menu Is Hide If The Uncorrect Password And Username Will Have The Msg .Box "Un Correct Password Or Username "
    If The Uncorrect Password Or Username More Than 3 Times The File Will Be Closed And Exit With The Msg.Box " 3 Times Uncorrect Password And Uersmane ,The File Will Closed And Exit Now"

    1.3 The User Can Change The New Password .If Click "Ok" The Sheet Main Is Hidden .The Msg.Box "Change The Password And Replace In Old Password Is Accepted "
    And The Sheet Munu Is Show With The Munu Bar Is Hidden
    Attached Files Attached Files
    Last edited by VBA Noob; 12-08-2007 at 05:09 AM.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    i have given you twod code examples which can be adapted if you study them.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I have given you example code that you can adapt. You haven't even tried!

  8. #8
    Forum Contributor
    Join Date
    09-22-2007
    Posts
    119
    Thank,roy uk that great for your help me
    i try to study the ex. but i feel quite silly ,i lack of knowledge how to do that ,can give me the ex.more possible
    hope that
    thank.

  9. #9
    Forum Contributor corinereyes's Avatar
    Join Date
    12-02-2003
    Location
    Philippines
    MS-Off Ver
    MS Excel 2016
    Posts
    520
    Hi Pichai,
    A little contribution for your query. I added some textboxes in your worksheet. If username and password is correct, it hides the Main sheet, hides the Toolbar and Menu bar (full screen in excel) and shows the Menu sheet.
    It’s not an elegant code but hope it will help you out. You can search for the rest of your query Attached xl file for the example.

    Code in Sheet1

    Please Login or Register  to view this content.
    Code in ThisWorbook:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Corine

  10. #10
    Forum Contributor
    Join Date
    09-22-2007
    Posts
    119
    THank,Roy uk and corinereyesfor your help
    i try to for the first ex.password of roy uk .
    i find out some code i must change it for me to use . as the ex.attachment
    but i get some queution i can not solve it
    i change some code to hide menu bar of sheet2 .but it is not work
    when i put the correct username and passord .the sheet2 activate
    it sheet is protected but the menu on the top of sheet 2 still show not hidden
    how can you help me this problem ??
    thank
    Attached Files Attached Files

  11. #11
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Hiding MenuBars & Toolbars can cause problems for the end user if the code does not return everything to the original settings. IMO leave it alone until you know more about VBA coding.

  12. #12
    Forum Contributor
    Join Date
    09-22-2007
    Posts
    119
    Thank,Roy UK for your help so much
    now ,i try it i use the code
    Application.CommandBars(1).Enabled = false
    that it work well

  13. #13
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by pichai
    Thank,Roy UK for your help so much
    now ,i try it i use the code
    Application.CommandBars(1).Enabled = false
    that it work well
    You must make sure that you re-enable it after the workbook closes!

  14. #14
    Forum Contributor
    Join Date
    09-22-2007
    Posts
    119
    Hi,royUK
    thank for your advice me so much .that is greatly appreciated .
    now, i have some more help
    is there a way to do , to set it . when i open the user form . i want the cursor in the txt.box of the username begin automatic for key the username
    thank i hope you help me

  15. #15
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Place this code in the UserForm_Initialize event, change TextBox1 to th correct TextBox

    Please Login or Register  to view this content.

  16. #16
    Forum Contributor
    Join Date
    09-22-2007
    Posts
    119
    Hi,thank roy UK
    that it work best
    see you after nice day
    pichai.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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