Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Excel to have User Name and Password?

Hello fellow programmers!

I was woundering if any one knew some code to allow me to do the
following...

I have 10 employees with 10 unique user names and 10 unique
passwords...

I have all 10 employees listed in Column A and all the passwords listed
in Column B, so I am wondering is it possible to create a UserForm to
allow a person to enter the user name and password to gain access to
workbook if it matches correctly to their name and password off the
values on the spreadsheet? Any help is greatly appreciated!!!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Excel to have User Name and Password?

Yes

You need to have an auto_open macro that opens a form for the user to enter
their name and password. You then check the name and password and if the name
and password agree then you can allow access.

You need to set all the sheets visibility to very hidden and you do that in
VB project exlorer except for one sheet that is a splash type screen. You
then password protect the vba project and then you save the work book hiding
all the sheets except 1.

You also have an auto_save and auto_close macro that saves the workbook
hiding the worksheets (for the save one you need to unhide the sheets
aft5erwards).


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


" wrote:

Hello fellow programmers!

I was woundering if any one knew some code to allow me to do the
following...

I have 10 employees with 10 unique user names and 10 unique
passwords...

I have all 10 employees listed in Column A and all the passwords listed
in Column B, so I am wondering is it possible to create a UserForm to
allow a person to enter the user name and password to gain access to
workbook if it matches correctly to their name and password off the
values on the spreadsheet? Any help is greatly appreciated!!!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Excel to have User Name and Password?

I appreciate your feedback but this isn't what I was hoping to do. I
have two diffrent columns with a user name and a password for a total
of 10 rows of information... A1:B10

I need to know how to program a VB User form to prompt for a user name
and password using the information from A1:B10 and grant access to the
workbook through the information stored inside of the workbook. The
plan is to have the page with the user names and passwords be read by
the VB User form and then if the password or user name doesn't match it
would display a message saying "Account doesn't exsist or invalid
entry...access is denied." If they got it the information correct it
would unhide a hidden spreadsheet... The idea is simple but I'm sure
the code isn't...I really need someone's help with this one!!! ANY HELP
IS MUCH APPRECIATED!!!




Martin Fishlock wrote:
Yes

You need to have an auto_open macro that opens a form for the user to enter
their name and password. You then check the name and password and if the name
and password agree then you can allow access.

You need to set all the sheets visibility to very hidden and you do that in
VB project exlorer except for one sheet that is a splash type screen. You
then password protect the vba project and then you save the work book hiding
all the sheets except 1.

You also have an auto_save and auto_close macro that saves the workbook
hiding the worksheets (for the save one you need to unhide the sheets
aft5erwards).


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


" wrote:

Hello fellow programmers!

I was woundering if any one knew some code to allow me to do the
following...

I have 10 employees with 10 unique user names and 10 unique
passwords...

I have all 10 employees listed in Column A and all the passwords listed
in Column B, so I am wondering is it possible to create a UserForm to
allow a person to enter the user name and password to gain access to
workbook if it matches correctly to their name and password off the
values on the spreadsheet? Any help is greatly appreciated!!!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Excel to have User Name and Password?

Well, you still need to follow principles laid out by Martin, but instead of
showing the worksheet, do you actions from the userform.
If unsuccessful login, show your MsgBox and Exit Sub.

If your worksheets are named for the person who uses it, you can a global
variable to work with, irrespective of the person involved, assuming each
sheet has the same structure.
Dim WorkingSheet as worksheet

if username/password=OK then
set WorkingSheet =Worksheets(Username)
else
set WorkingSheet =nothing
msgbox "failed..etc"
exit sub
end if

NickHK

wrote in message
oups.com...
I appreciate your feedback but this isn't what I was hoping to do. I
have two diffrent columns with a user name and a password for a total
of 10 rows of information... A1:B10

I need to know how to program a VB User form to prompt for a user name
and password using the information from A1:B10 and grant access to the
workbook through the information stored inside of the workbook. The
plan is to have the page with the user names and passwords be read by
the VB User form and then if the password or user name doesn't match it
would display a message saying "Account doesn't exsist or invalid
entry...access is denied." If they got it the information correct it
would unhide a hidden spreadsheet... The idea is simple but I'm sure
the code isn't...I really need someone's help with this one!!! ANY HELP
IS MUCH APPRECIATED!!!




Martin Fishlock wrote:
Yes

You need to have an auto_open macro that opens a form for the user to

enter
their name and password. You then check the name and password and if the

name
and password agree then you can allow access.

You need to set all the sheets visibility to very hidden and you do that

in
VB project exlorer except for one sheet that is a splash type screen.

You
then password protect the vba project and then you save the work book

hiding
all the sheets except 1.

You also have an auto_save and auto_close macro that saves the workbook
hiding the worksheets (for the save one you need to unhide the sheets
aft5erwards).


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


" wrote:

Hello fellow programmers!

I was woundering if any one knew some code to allow me to do the
following...

I have 10 employees with 10 unique user names and 10 unique
passwords...

I have all 10 employees listed in Column A and all the passwords

listed
in Column B, so I am wondering is it possible to create a UserForm to
allow a person to enter the user name and password to gain access to
workbook if it matches correctly to their name and password off the
values on the spreadsheet? Any help is greatly appreciated!!!





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Excel to have User Name and Password?

How about this idea?

Sub askforpassword()
On Error GoTo nogood
ans = InputBox("enter password")
If Range("passwords").Find(ans).Row 0 Then
'MsgBox "OK"
Sheets("sheet7").Unprotect
Exit Sub
End If
nogood: MsgBox "Access denied"
End Sub

--
Don Guillett
SalesAid Software

wrote in message
ups.com...
Hello fellow programmers!

I was woundering if any one knew some code to allow me to do the
following...

I have 10 employees with 10 unique user names and 10 unique
passwords...

I have all 10 employees listed in Column A and all the passwords listed
in Column B, so I am wondering is it possible to create a UserForm to
allow a person to enter the user name and password to gain access to
workbook if it matches correctly to their name and password off the
values on the spreadsheet? Any help is greatly appreciated!!!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Excel to have User Name and Password?

Don,

Thank you so much your code worked just the way I wanted it to!! Your
the best!

-Todd

Don Guillett wrote:
How about this idea?

Sub askforpassword()
On Error GoTo nogood
ans = InputBox("enter password")
If Range("passwords").Find(ans).Row 0 Then
'MsgBox "OK"
Sheets("sheet7").Unprotect
Exit Sub
End If
nogood: MsgBox "Access denied"
End Sub

--
Don Guillett
SalesAid Software

wrote in message
ups.com...
Hello fellow programmers!

I was woundering if any one knew some code to allow me to do the
following...

I have 10 employees with 10 unique user names and 10 unique
passwords...

I have all 10 employees listed in Column A and all the passwords listed
in Column B, so I am wondering is it possible to create a UserForm to
allow a person to enter the user name and password to gain access to
workbook if it matches correctly to their name and password off the
values on the spreadsheet? Any help is greatly appreciated!!!


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default Excel to have User Name and Password?

i am not able to know that hws r u running this code.

when ever i try to run this macro its asking me the password.

where & what password to type.

Where to store the password.

pls do tell me that....

Awaiting for ur mail

Akash

On Jan 12, 6:57 am, wrote:
Don,

Thank you so much your code worked just the way I wanted it to!! Your
the best!

-Todd

Don Guillett wrote:
How about this idea?


Sub askforpassword()
On Error GoTo nogood
ans = InputBox("enter password")
If Range("passwords").Find(ans).Row 0 Then
'MsgBox "OK"
Sheets("sheet7").Unprotect
Exit Sub
End If
nogood: MsgBox "Access denied"
End Sub


--
Don Guillett
SalesAid Software

wrote in message
oups.com...
Hello fellow programmers!


I was woundering if any one knew some code to allow me to do the
following...


I have 10 employees with 10 unique user names and 10 unique
passwords...


I have all 10 employees listed in Column A and all the passwords listed
in Column B, so I am wondering is it possible to create a UserForm to
allow a person to enter the user name and password to gain access to
workbook if it matches correctly to their name and password off the
values on the spreadsheet? Any help is greatly appreciated!!!


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Excel to have User Name and Password?

Akash,

Work with the code to figure it out...its not difficult to figure
out since he provided me the proper sequence and santax of the code...A
true coder / Excel Developer doesn't always need the exact method or
procedure to alter code to work it the neccessary method. Thanks to his
code I am now able to have diffrent passwords to run for diffrent
features of a workbook. I didn't use his code the way he displayed but
merely altered it to do what I wanted it to do...


Akash wrote:
i am not able to know that hws r u running this code.

when ever i try to run this macro its asking me the password.

where & what password to type.

Where to store the password.

pls do tell me that....

Awaiting for ur mail

Akash

On Jan 12, 6:57 am, wrote:
Don,

Thank you so much your code worked just the way I wanted it to!! Your
the best!

-Todd

Don Guillett wrote:
How about this idea?


Sub askforpassword()
On Error GoTo nogood
ans = InputBox("enter password")
If Range("passwords").Find(ans).Row 0 Then
'MsgBox "OK"
Sheets("sheet7").Unprotect
Exit Sub
End If
nogood: MsgBox "Access denied"
End Sub


--
Don Guillett
SalesAid Software

wrote in message
oups.com...
Hello fellow programmers!


I was woundering if any one knew some code to allow me to do the
following...


I have 10 employees with 10 unique user names and 10 unique
passwords...


I have all 10 employees listed in Column A and all the passwords listed
in Column B, so I am wondering is it possible to create a UserForm to
allow a person to enter the user name and password to gain access to
workbook if it matches correctly to their name and password off the
values on the spreadsheet? Any help is greatly appreciated!!!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Password protection excel document - last user setting lost Jon's problem Excel Discussion (Misc queries) 0 October 23rd 07 11:52 PM
User not being prompted to enter Password to modify Excel 2003 kmorl Excel Discussion (Misc queries) 2 October 20th 06 05:32 PM
Excel 2000 required multiple user name and password logins ISTech Excel Programming 0 August 23rd 05 08:19 PM
ADO / Excel & Access: User ID and Password Santiago[_2_] Excel Programming 0 August 5th 05 09:22 PM
User name & password access to Excel files in a folder Maria[_6_] Excel Programming 4 November 17th 03 06:44 PM


All times are GMT +1. The time now is 06:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"