Closed Thread
Results 1 to 8 of 8

How to make audit trail to log which persons ever edited an excel file?

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    95

    Question How to make audit trail to log which persons ever edited an excel file?

    How to make audit trail to log which persons ever edited an excel file? e.g. to record down the Author name and Company (refer to Excel menu -> File -> Properties" and date/time stamp on a worksheet. Thanks

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to make audit trail to log which persons ever edited an excel file?

    This should get you started...

    1) Create a sheet called AuditLog in your workbook and hide it, if you wish.
    2) Open the VBEDditor (Ctrl-F11) and add this macro to the ThisWorkbook module:

    Please Login or Register  to view this content.
    It will put the computer username and timestamp onto the AuditLog sheet as soon as anyone opens the sheet, so you'll know everyone who opens the workbook, whether they change anything or not.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-30-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: How to make audit trail to log which persons ever edited an excel file?

    Thanks for your reply! I modified a little bit to capture excel username instead of windows login name. But I have 3 more requests:

    1. also capture Company name in excel or full computer name stored in windows
    2. capture what have been changed in cells.
    3. keep up to 999 records.

    Please Login or Register  to view this content.
    Last edited by ohlalayeah; 07-30-2012 at 01:34 AM.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to make audit trail to log which persons ever edited an excel file?

    Setup the AuditLog with the following Column Headers

    http://screencast.com/t/tsLKQZtSCZgE

    Please Login or Register  to view this content.
    Then put all these macros into your ThisWorkbook module:
    Please Login or Register  to view this content.


    When the workbook is opened, it will record the user name and computer name. Then every edit they make will be recorded, including the prior value.

    The possible values you can use for the Environs("somevaluehere") are:

    ALLUSERSPROFILE
    APPDATA
    CLASSPATH
    CommonProgramFiles
    CommonProgramFiles(x86)
    CommonProgramW6432
    COMPUTERNAME
    ComSpec
    FP_NO_HOST_CHECK
    HOMEDRIVE
    HOMEPATH
    LOCALAPPDATA
    LOGONSERVER
    NUMBER_OF_PROCESSORS
    OnlineServices
    OS
    Path
    PATHEXT
    PCBRAND
    Platform
    PROCESSOR_ARCHITECTURE
    PROCESSOR_IDENTIFIER
    PROCESSOR_LEVEL
    PROCESSOR_REVISION
    ProgramData
    ProgramFiles
    ProgramFiles(x86)
    ProgramW6432
    PSModulePath
    PUBLIC
    QTJAVA
    SESSIONNAME
    SystemDrive
    SystemRoot
    TEMP
    TMP
    USERDOMAIN
    USERNAME
    USERPROFILE
    WecVersionForRosebud.13E8
    windir
    windows_tracing_flags
    windows_tracing_logfile

  5. #5
    Registered User
    Join Date
    02-23-2012
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How to make audit trail to log which persons ever edited an excel file?

    This script works perfectly on changes made manually onto the respective cells. However, it is not able to log in the changes to cells that changes accordingly to the IF condition input. Anyway to resolve this issue?

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to make audit trail to log which persons ever edited an excel file?

    Sure, as per forum rules, open a thread of your own and ask that question specifically. You can link to and refer to this thread and this code if you wish.

  7. #7
    Registered User
    Join Date
    02-15-2013
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: How to make audit trail to log which persons ever edited an excel file?

    This works great when i use it for files stored on my desktop, but testing it for files on the corporate network do not yield any results. Could this be related to permissions set on the network?

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to make audit trail to log which persons ever edited an excel file?

    That would be a question for another thread or forum section. As per forum rules, remember to start your own threads for your own inquiries. You can provide links to other threads you want considered in your new question. Thanks.

Closed Thread

Thread Information

Users Browsing this Thread

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

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