+ Reply to Thread
Results 1 to 8 of 8

Tracking access to Excel file through VBA rutine

  1. #1
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    373

    Tracking access to Excel file through VBA rutine

    Morning and Happy Holidays!

    I was looking for some help on a VBA solution. I would like to run an on open event for a scheduling workbook. It should open a logging workbook, write the %username% to the first blank line in A:A then save and close the logging workbook, leaving the scheduling workbook open and ready for input.

    The following UNC can be used as the location for the logging workbook.

    \\ComputerName\ParentFolder\ChildFolder\LogFiles

    If possible, I would like this logging to be transparent to the end user.

    As always thanks for the help and have a GREAT HOLIDAY SEASON!
    Last edited by scaffdog845; 12-28-2009 at 11:25 AM. Reason: Solved
    Click here to read the Forum Rules
    Whatever it is in life you decide to go after, go after with great ferocity.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Tracking access to Excel file through VBA rutine

    Maybe like this (untested):
    Please Login or Register  to view this content.
    Last edited by shg; 12-23-2009 at 04:23 PM. Reason: corrected per subsequent posts
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    373

    Re: Tracking access to Excel file through VBA rutine

    SHG

    Merry Texmas to you too!

    Thanks for the try but I don't belive anything is happening with this code.

    I tested with a new .xlsm workbook and added your code as a module.

    The logfile to write to is named
    Please Login or Register  to view this content.
    and is located in the
    Please Login or Register  to view this content.
    directory. The extra space between Management & KPIs is not a typo, it was how the directory structure was created long before I got here.

    Your code has been edited to match the actual directory structure and work book name.
    Please Login or Register  to view this content.
    Nothing is being written to "Daily Schedule Access Logfile.xlsx" nor is a message box reporting any errors even if I temporarily remove the "Daily Schedule Access Logfile.xlsx" file.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Tracking access to Excel file through VBA rutine

    So you single-step through the code, and what happens?

  5. #5
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    373

    Re: Tracking access to Excel file through VBA rutine

    I had to figure out how to single step through code. I'm getting a Run-time error '438': Object doesn't support this property or method on .
    Please Login or Register  to view this content.
    It did open the file and log the username as expected.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Tracking access to Excel file through VBA rutine

    Please Login or Register  to view this content.
    That was among the untested parts

    Corrected in prior post for future generations ...

    Also, note it's .Close, not Close

  7. #7
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    373

    Re: Tracking access to Excel file through VBA rutine

    Thanks SHG

    I wont be able to test it until Monday. Have a great Christmas

  8. #8
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    373

    Re: Tracking access to Excel file through VBA rutine

    SHG

    Testing done. It works just as expected. Thanks for the help!!

+ Reply to 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