peace to everyone!
i used xcel 2007 n also vba which in there..
i want user login to my worksheet..so how can i do that..?
thanks!
One way would be to create a userform, with username and password (you
can set a text box property password chr to * or something to hide the
password), the command button would then do a lookup against a sheet
and work out if the username and password match, if they dont you
could keep a count of attemps and after three close the workbook.
You would then show the form from the workbook open event.
You would also need to control saving the workbook (using the workbook
save event) to ensure that sheets are not left visible (otherwise I
could just disable the macros and gain access), a workaround could be
to put the login form in another workbook and when your user enters
the correct username and password it then opens the real workbook
(this would depend on whether all your users are on the same network
etc.)...
Please note that after doing all this it still is not at all secure...
To make it slightly more secure, you would make the sheet holding the
password/username as "Very hidden" and lock the vba project again
anyone could run code against the workbook to extract the usernames
and passwords, another way would be to hold the usernames and
passwords in vba but then you have a maintenance issue.
A simpler and much more secure route would be put a password on the
excel file but then it depends on what your trying to accomplish?!
James