+ Reply to Thread
Results 1 to 12 of 12

insert password

  1. #1
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    insert password

    Hello to all,
    ask help for a curiosity.
    I have a workbook that appears at startup with a notice of welcome userfom.
    This userform can close immediately with the close button or wait until the end of the scrolling text.
    You can change this?:
    ----------------------------------------------------------------------------------------------------------------------
    instead of the close button to add a box in which to enter a password (already established in VBA) and if I enter the exact file you start otherwise closes.
    --------------------------------------------------------------------------------------------------------------------
    Thanks in advance.
    I hope I explained.
    I attach the sample file.
    In advance thank you.
    max_max

    ==========================================================================================

    Ciao a tutti,
    chiedo un aiuto per una curiosità.
    Ho un workbook che all'avvio compare un avviso di benvenuto con userfom.
    Questa userform posso chiuderla subito con il pulsante chiudi o aspettare la fine del testo scorrevole.
    è possibile questa modifica?:
    ----------------------------------------------------------------------------------------------------------------------
    al posto del pulsante chiudi aggiungere una casella in cui inserire una password (già stabilita in VBA) e se la inserisco esattamente il file si avvia altrimenti si chiude.
    --------------------------------------------------------------------------------------------------------------------
    Grazie in anticipo.
    Spero di essermi spiegato.
    Allego il file di esempio.
    In anticipo ringrazio.
    max_max

    prova password.xls

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: insert password

    Ciao max_max,

    In the attached workbook, the UserForm has been modified for the password. The UserForm is modal, the close X has been removed, closing the Userform using ALT+F4 is disabled, and the user's login Id is used to lookup the password on a new sheet "Elenco".

    This sheet holds the allowed user ids and their passwords. If the password and user id do not match then the workbook closes. You should set this sheet's Visible property to xlSheetVeryHidden. This prevents the user from making the worksheet visible. This property can only be changed using the VB Editor. You can change it to xlSheetVisible when you need to edit the list.

    The workbook closing feature has been disabled to allow you to setup the user ids and passwords. Once you have done this, you will need to edit the OK button code on the UserForm. Remove the comment character from the beginning of the line marked in bold and save the change.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: insert password

    Hello Leith Ross,
    Thank you for your help.
    there is an error here in module remove_close:
    error.jpg
    max_max
    -----------------------------------------------
    Ciao Leith Ross,
    grazie per l'aiuto.
    C'è un errore qui nel modulo remove_close:
    error.jpg
    max_max

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: insert password

    Ciao max_max,

    Replace the code in the module Remove_Close_X_From_Menubar with the code below.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: insert password

    Hello,
    I entered it into Sheet2 (elenco):
    nomeutente = massimo
    password = 123456
    does not work.
    I attach the file
    max_max
    ---------------------------------------
    Ciao,
    ho inserito nel foglio2 (elenco):
    nomeutente = massimo
    parola di accesso = 123456
    non funziona.
    Allego il file.
    max_max

    errror2.jpg
    prova password ver 1.xls

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: insert password

    Hello max_max,

    Is massimo your Windows logon id?

    Edit: I just look at the workbook. There is no sheet named "Elenco".

  7. #7
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: insert password

    My windowsusername is "massimo".

  8. #8
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: insert password

    Error run time 13
    Type Mismatch

    --------------------------------------------------------------------
    ' Look up the user id and password.

    UserId = "WindowsUserName" '<<<<< changed here
    'UserId = Environ("USERNAME")

    pwd = Application.VLookup(UserId, Rng, 2, 0)

    If pwd = TextBox1 Then '<<<<<< error here
    MsgBox "Login Successful!"
    Else
    MsgBox "Login Failed. This Workbook will now Close.", vbExclamation + vbOKOnly
    ' Remove the comment character (single quote) from the line below after you have edited Elenco.
    ThisWorkbook.Close SaveChanges:=False
    End If
    --------------------------------------------------------------------

    max_max

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: insert password

    Hello max-max,

    I believe I have corrected all the problems. Try the attached workbook below and let me know the results.
    Attached Files Attached Files

  10. #10
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: insert password

    Hello Leih Ross,
    now it's perfect!
    Thank you very much.
    Greetings from Italy.
    max_max
    ----------------------
    Ciao Leih Ross,
    ora è perfetto!
    Grazie mille.
    Un saluto dall'Italia.
    max_max

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: insert password

    Ciao Massimo,

    Siete i benvenuti. Sono lieto di potervi aiutare.
    (Still learning Italian)

  12. #12
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: insert password

    I hope my English is understandable in this forum.
    The translation is done with google translator.
    Hello,
    max_max
    --------------------------------------------------------
    Spero che il mio inglese in questo forum sia capibile.
    La traduzione è fatta con google traduttore.
    Ciao,
    max_max

+ 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. Protecting cells so that a password is required only to Insert Comment.
    By hshen801 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-04-2013, 03:20 AM
  2. Replies: 1
    Last Post: 12-04-2013, 02:23 AM
  3. External web query to insert password
    By RossChapman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-28-2013, 04:20 PM
  4. Insert signature image - password protected
    By Dusty Hoffman in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-11-2008, 10:41 PM
  5. insert password protected spreadsheet
    By RZT27Y in forum Excel General
    Replies: 1
    Last Post: 09-30-2005, 06:05 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