Results 1 to 10 of 10
  1. #1
    Lounger
    Join Date
    Jul 2001
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Excel drilldown - Security (Excel97 SR-2b on NT)

    Within Excel97 is there a capability to set security (in the background - example - if this person they can access this link). I'm wanting drilldown capability within ONE workbook with security access within it that doesn't include a password.

    Any help out there?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Excel drilldown - Security (Excel97 SR-2b on NT)

    You could base security on the USERNAME property (this is what is entered in tools -options - general - user name)
    In your macro code: If user name is within a list do something, if not in a list do not allow.
    if Application.username = "Bill Smith" then
    'your code here
    endif


    It can be bypassed easily enough by disabling macros or changing your username.

    YOu could also base it on the computer name obtained from the environ function in vb:

    if Environ("computername") = "abcde" then
    'your code here
    endif


    Steve

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Excel drilldown - Security (Excel97 SR-2b on NT)

    I like the second way and want to add that that, in case someone has monkeyed with the Application Username, you -may- be able to get the computer username, which is usually the login name, not the usual user, the same way (but watch for character case differences):

    If Environ("USERNAME") = "johnbf" then Exit Sub

    This has the advantage of showing who is logged on, rather than the usual user.
    -John ... I float in liquid gardens
    UTC -7ąDS

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel drilldown - Security (Excel97 SR-2b on NT)

    The environ function doesn't return my username on my win98/xl2000 system.

    Alternatively, use this API function:

    <pre>Option Explicit
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''
    ' Copyright
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Excel drilldown - Security (Excel97 SR-2b on NT)

    The environment variable "username" setting is applied by sysadmin on my corporate LAN and is identical to the login name.

    Jan Karel, exactly what is (or where is the source of) the function you posted returning?
    -John ... I float in liquid gardens
    UTC -7ąDS

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel drilldown - Security (Excel97 SR-2b on NT)

    In my case it returns my username i.e. my login name (the one I use to logon to the network).
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  7. #7
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel drilldown - Security (Excel97 SR-2b on NT)

    Jan,

    Can this API function be used to determine who has an Excel file open? I am aware that the code is returning the login name of the individual (login name to network) and thought perhaps it could also be used on an open Excel file similar to Excel's file reservation.

    John

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel drilldown - Security (Excel97 SR-2b on NT)

    No, it just returns the logon name of the computer the code is run on.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  9. #9
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel drilldown - Security (Excel97 SR-2b on NT)

    I didn't think so either. Have you seen any code on Excel's file reservation? I can't find anything on who is modifying the file or has the file reservation.

    John

  10. #10
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel drilldown - Security (Excel97 SR-2b on NT)

    No, no code found yet. Sorry.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •