+ Reply to Thread
Results 1 to 6 of 6

Show the Username of the Person who Opened A File as Read Only

  1. #1
    Forum Contributor
    Join Date
    01-15-2015
    Location
    philippines
    MS-Off Ver
    Excel 365
    Posts
    116

    Show the Username of the Person who Opened A File as Read Only

    Hi,

    I need help with this item please.
    I have already searched this forum if this has been asked in the past, but I cant seem to find anything. If in case I missed it, I apologize and kindly direct me to that thread.

    If not, here is the item that I need help with.

    We have a shared drive wherein everyone can access the files placed on that drive. All the files are password protected. Most often, we just open a file as read only and do what we have to do with that file. What I would want to know is that, what would be the VBA code wherein the file would say - through a Message Box - that the file has already been opened and it would show the username of that person who has opened the file in read only. The VBA should only work if someone has already opened the file as read only.

    Thanks for the assistance.

  2. #2
    Registered User
    Join Date
    10-15-2013
    Location
    Hawaii
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Show the Username of the Person who Opened A File as Read Only

    I believe the point of Read-Only is that you do not modify the file, including it's properties. I believe you would be able to do this using Windows Audit Policy, but that is a bit off topic of this forum.

  3. #3
    Forum Contributor
    Join Date
    01-15-2015
    Location
    philippines
    MS-Off Ver
    Excel 365
    Posts
    116

    Re: Show the Username of the Person who Opened A File as Read Only

    Hi Cebalaw,

    Thanks for looking into this. However, I would like to differ.
    There has been several discussions over the internet related to this task. They are just outdated that they no longer work on versions of excel from 2013 onwards, as to what I understand. That's why Im asking for help in this forum that maybe someone can provide me a VBA code that will work on newer versions of excel.
    Thanks to that someone in advance

  4. #4
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: Show the Username of the Person who Opened A File as Read Only

    i think if someone can send you code for log activity for all user i think it can work

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Show the Username of the Person who Opened A File as Read Only

    If you know the particulars you should be able to assign a variable:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  6. #6
    Forum Contributor
    Join Date
    01-15-2015
    Location
    philippines
    MS-Off Ver
    Excel 365
    Posts
    116

    Re: Show the Username of the Person who Opened A File as Read Only

    I just thought that maybe through this thread and this forum, this item would become useful in the future. But anyway, if no one has that answer yet, maybe we can work on a workaround.
    Is it possible to run a code upon opening a file as read only? The code being it will dump a timestamp and the username on another file. This file has three columns on it. First column (A) would be the time stamp when the user opened the file as read only, the third column (C) would be his username, then the second column (B) would be the time when he closed the file.
    So, when someone still has the file opened, as read only, and then another user will open the same file, the code will search for the latest entry in column A then look for the entry to its left, which is in column B. If that cell is empty, a message box would pop up saying that the file is currently being used by user - as latest username appears on column c - since the user must have not closed the file yet as there is no entry there. If all the latest entries in all columns are complete, then you can just proceed with how you normally do when you open a password-protected file.
    All columns have running data on it. Meaning, after 1 timestamp has been posted in their respective columns, the next one would be just beneath the other and so on.

    I hope its not confusing and that I have explained it well.
    Thanks for your help.
    Last edited by richardking; 07-19-2017 at 02:08 PM.

+ 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. Replies: 0
    Last Post: 01-24-2014, 09:10 AM
  2. [SOLVED] Checking to see if a file has been opened in Read/Write or Read Only
    By brokenbiscuits in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-13-2014, 09:16 AM
  3. Replies: 4
    Last Post: 01-09-2014, 03:13 PM
  4. [SOLVED] stop excel file opened as read only if already opened by another u
    By bobm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-09-2011, 08:45 AM
  5. Beforeclose problem when file is opened as Read only
    By Bluewhistler in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2010, 04:14 AM
  6. Replies: 0
    Last Post: 04-20-2006, 11:45 PM
  7. Windows API to get network username of person with file open
    By Paul Martin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-02-2005, 12:35 PM
  8. Replies: 2
    Last Post: 08-28-2005, 12:05 PM

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