Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Start up security

Is it possible to enter code into an excel file that looks for a network user
name as the file opens. If your user name is not on the network, then the
file will not open. I realise that security for Excel is dodgy at the best
of times, but it is a start.

I have set range passwords for the worksheets, but need to prevent the file
from opening.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Start up security

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

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

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
start:1 and start:2 - how did i get 2 copies? LuvHaleiwa Excel Discussion (Misc queries) 1 December 21st 07 09:14 PM
start learning Excel/VBA, where to start from? Any online video lectures? cfman Excel Programming 8 September 29th 06 10:40 AM
OT :Start your own online business today !start making dollars [email protected] Excel Discussion (Misc queries) 0 May 6th 06 09:29 PM
Start spreadsheet with WinXP start Gordon Gradwell Excel Worksheet Functions 1 July 13th 05 11:35 AM
Macro Start Autorun without Enable security Jack Excel Programming 9 February 2nd 05 02:59 PM


All times are GMT +1. The time now is 04:31 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"