Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A password question

Hi,
my office is currently using Windows NT, but within months Windows XP
will be used.

I've made a timewokbook and want to protect it in such a way that only
I or the employee can open it.

My idea is
a) All employees have his/her own genuine server user_name. I want to
use this in a verification test.
b) I'm the section leader and shall have right of admission to all
timeworkbooks. My server user_name should be entered in cell A1 in
Sheet1 in all timeworkbooks. Each time I try to open the timeworkbook
from my own computer, a macro should compare the value entered in cell
A1 with the server user_name entered in the login window when the
computer is restarted every day.
c) The server user_name for each employee should be entered in cell B1
in Sheet1, and only in the file he/she use. The macro should compare
the value entered in cell B1 with the ser user_name entered in the
login window when the computer is restarted every day. The purpose is
that he/she should not be allowed to open the timeworkbook belonging
to other employees.

Could this be done?

Sincerely
Andy-s
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default A password question

Mr. Erlandsend's site:
http://www.erlandsendata.no/english/vba/os/index.php

has code for username and computer name.

---------------
Another example

From: Trevor Shuttleworth )
Subject: Code to show login name
Newsgroups: microsoft.public.excel.programming
Date: 2001-01-16 12:54:01 PST



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

Sub GetUserNameTest()
MsgBox fOSUserName
End Sub

Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If lngX < 0 Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = ""
End If
End Function

-------------------


Regards,
Tom Ogilvy



Andy Smith wrote in message
om...
Hi,
my office is currently using Windows NT, but within months Windows XP
will be used.

I've made a timewokbook and want to protect it in such a way that only
I or the employee can open it.

My idea is
a) All employees have his/her own genuine server user_name. I want to
use this in a verification test.
b) I'm the section leader and shall have right of admission to all
timeworkbooks. My server user_name should be entered in cell A1 in
Sheet1 in all timeworkbooks. Each time I try to open the timeworkbook
from my own computer, a macro should compare the value entered in cell
A1 with the server user_name entered in the login window when the
computer is restarted every day.
c) The server user_name for each employee should be entered in cell B1
in Sheet1, and only in the file he/she use. The macro should compare
the value entered in cell B1 with the ser user_name entered in the
login window when the computer is restarted every day. The purpose is
that he/she should not be allowed to open the timeworkbook belonging
to other employees.

Could this be done?

Sincerely
Andy-s



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
Not your usual password question! Andy Excel Discussion (Misc queries) 6 December 1st 09 03:31 PM
VBA Password Question Danny Excel Worksheet Functions 0 September 5th 07 05:00 PM
how to automate opening a password protected excel file? e.g. a .xls that has a password set in the security tab. Daniel Excel Worksheet Functions 0 June 23rd 05 11:56 PM
Password Loop question. Andy Tallent Excel Discussion (Misc queries) 1 April 8th 05 01:16 PM
bypass password when update linking of password protected file Yan Excel Discussion (Misc queries) 1 February 7th 05 11:29 PM


All times are GMT +1. The time now is 09:33 AM.

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

About Us

"It's about Microsoft Excel"