+ Reply to Thread
Results 1 to 4 of 4

detect windows user name and allow access to excel file

  1. #1
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    detect windows user name and allow access to excel file

    Hi, how do I create a file on a network drive that can only be opened by a group of people? The idea is that this file will contain a list of people that can have access to the file written on one of the spreadsheet. When they try to open the file, a code runs and tries to match their windows log on name to the list in the file. If matched, file opens. If it doesn't, file closes.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: detect windows user name and allow access to excel file


    Hi,

    with VBA Environ function for example, you can read the USERNAME …

    Or you just have to set the trustees of the file in Windows …

  3. #3
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: detect windows user name and allow access to excel file

    Hi Marc, how do I write the code for that?

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: detect windows user name and allow access to excel file

    It would be much better just to give them a password or put it in a folder only they can access. Doing this in code is fraught with issues

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Multiple user write access to an Excel 2010 file
    By musik7 in forum Excel General
    Replies: 1
    Last Post: 03-21-2014, 01:24 PM
  2. Detect attempt to switch between open excel files (windows) during loop
    By lahansen2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-02-2014, 03:10 PM
  3. write on an excel file over the network that user only has read-only access to
    By vangxbg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2013, 08:41 AM
  4. Excel allows access to more than one user to same file
    By Bernie G in forum Excel General
    Replies: 2
    Last Post: 03-08-2006, 05:10 AM
  5. Detect Excel was started with Windows Task Scheduler
    By RB Smissaert in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-01-2005, 08:06 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1