Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
kil kil is offline
external usenet poster
 
Posts: 1
Default creating a username and password box

do anyone know how to create a username/password box with
a userform in microsoft Excel, I tried creating one but
not able to get the excel to make decision of who is
accessing, I don't want to use excel protect book, where
it will exposed all my work to every user,


here is my cod

if txtname= user

then workbookfiance.activate


am I'm on the right track?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default creating a username and password box

You will need to save the allowable users in a list somewhere and compare
the current user against that.

You can get the login user with

Private Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" _
(ByVal lpBuffer As String, _
nSize As Long) As Long

Public Function UserName() As String
Dim sName As String * 256
Dim cChars As Long
cChars = 256
If GetUserName(sName, cChars) Then
UserName = Left$(sName, cChars - 1)
End If
End Function

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.LeftFooter = UserName
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"kil" wrote in message
...
do anyone know how to create a username/password box with
a userform in microsoft Excel, I tried creating one but
not able to get the excel to make decision of who is
accessing, I don't want to use excel protect book, where
it will exposed all my work to every user,


here is my cod

if txtname= user

then workbookfiance.activate


am I'm on the right track?



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
link from web page to excel asks for username and password BC Excel Discussion (Misc queries) 0 October 18th 09 04:40 PM
link to workbook from web page asks for username and password BC Excel Discussion (Misc queries) 0 October 16th 09 03:56 PM
How do I get a adcenter username and password Chops Excel Discussion (Misc queries) 0 November 11th 08 11:31 PM
Is there a template for username and password storage for Excel? help Excel Discussion (Misc queries) 1 May 17th 05 03:29 PM
username and password for form excel vba macro finalfantasy_2u Excel Programming 0 January 9th 04 06:07 AM


All times are GMT +1. The time now is 07:36 AM.

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"