Hello, I am trying to create a login page for my excel document to make sure only the correct people can access this.
Does anyone know a code for this?
Sorry, I just got started with VBA, so...
Thanks!
Hello, I am trying to create a login page for my excel document to make sure only the correct people can access this.
Does anyone know a code for this?
Sorry, I just got started with VBA, so...
Thanks!
Password Protect the Wordbook. That is a little bit more secure than writing all the passwords in plain text inside a "Log In" macro.
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ
Thanks- but actually I'm not to worried about security.
It just has to look good for my teacher, so...
Try this
1. Add a blank or decorated WS ("Opening")
2. Add a pretty userform ("Logon") with a pictures, labels, etc. and two TextBoxs (tbUserName and tbPassword) and a command button (cbLogon)
3. In the ThisWorkbook module, BeforeClose event make "Opening" visible = true and all other worksheets visible=veryhidden
4. In the ThisWorkbook module, Open event make "Opening" visible = true and all other worksheets visible=veryhidden, and then load and show Logon
5. Add code to cbLogon to check tbUserName against tbPassword and count the number of attempts
6a. If they 'match', close the UF, show all the worksheets, and hide "Opening"
6b. If the don't match after 3 tries, then close the WB without saving
As Samt says, there is no real security by doing this, but if 'form' is more important than 'substance' it should be OK
PW protect the project also anyways
Post an example if you want feedback
---------------------------------------------------------------------------------------------------------------------
Paul
Remember: Tell us WHAT you want to do, not HOW you think you want to do it
1. Use [CODE] ....[/CODE ] Tags for readability
[CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
2. Upload an example
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
3. Mark the thread as [Solved] when you have an answer
Thread Tools (on the top right corner, above the first message)
4. Read the Forum FAQ, especially the part about cross-posting in other forums
http://www.vbaexpress.com/forum/faq...._new_faq_item3
That's good, thanks!