Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use windows authentication in VBA for excel

Status
Not open for further replies.

Mago1234

Programmer
May 13, 2003
5
AU
Hi,

I need to build an Excel application (excel 2000) that uses Windows authentication. That is to say, when the user clicks on the excel spread sheet, he is required to enter his Windows user name and password before he can view the content of the spreadsheet. I was told that in the program I need to call some Windows API's, but I don't know how to do it, and there seems to be nowhere to be found on the Web. I know how to read a user's Windows login name via calling mpr.dll. But how to enforce a windows authentication before the user can open the file?

Thanks.
 
Well, I very much doubt you can get the password off the system to check against - that'd go against every security / virus protection protocol going so you may be banging your head against a very solid brick wall on this one

Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Hi Geoff

I don't really want to get the password off the system to check against, but I want to make sure that the user's password and user name are the same as their Windows Login ID and password. There is no need to get the password stored in the Windows registry in clear.

Please suggest how can that be achieved.
 
Well you can get the login Id by using
myID = environ("username")
but I dunno about passwords

Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top