+ Reply to Thread
Results 1 to 8 of 8

Usage Log

  1. #1
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Usage Log

    I have written a usage log into a spreadsheet to see who is entering the sheet, this is fine but some user names are not shown, only the time they entered, all macros are activated but there name is hidden, why is this?

    Also if someone is in a sheet no matter what worksheet they are in and i try to go in, it comes up read only, but instead of it saying, "The sheet is locked for editing by FBF" i says " The sheet is locked for editing by ."

    Anyone got any answers please

    Thanks

    FBF

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello FBF,

    What code are you using to extract the User's name?

    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459
    Please Login or Register  to view this content.
    Last edited by VBA Noob; 02-07-2008 at 05:31 PM.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello FBF,

    You are returning the local user name, and not the system logon name. Use this code instead..
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  5. #5
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459
    Excellant thanks very much,

    Now for question 2 if thats ok?

    This code now is working fine but if i want the path to go to a resticted folder then i get an error if i havent got the privilages for the folder, is there a way that i can still write the information to this folder, without the error.

    I let you know the scenario

    I work for a company that has a main spreadsheet, only managment should be going into this sheet, but sometimes the password is cracked so i need to know who is entering the sheet, only problem is, if non managment open the usage log they can deleate their entry, i want a way that i can hold this information without it being deleated.

    Thanks

    FBF

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello FBF,

    The most secure way would be to save it to the Registry. VBA has the SaveSetting, and GetSetting methods to access the registry. Although this an easy way to save and retrieve information from the registry, it is also easy to delete using the DeleteSetting method. This would delete all the stored information, and you would know someone broke security.

    The more secure way is to use Windows API calls to save and retrieve information from the registry. The downside is all the variables that can affect the porper functioning of the API calls. Even more so if you are using a network.

    I have code to this and have done many times to secure or save data. If you can tell me more about your system, we could most likely come up with a solution.

    Sincerely,
    Leith Ross

  7. #7
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459
    Its all secured from IT administrators, so i would be able to get into the registry

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello FBF,

    If the workbook is on your computer then you don't special access rights to the registry. However, if the workbook resides on the network then you made need IT to grant you the necessary permissions.

    Security with VBA is not good due to several factors. The code is never saved as a compiled project which makes the source code always available. Another major factor is passwords. All VBA passwords can be broken, and done so quickly. Spend a little time surfing the subject, and see for yourself. As always, security is directly related to the knowledge of the user.

    Another option maybe saving your workbook as an interactive HTML document. The users can then only interact, but not change a network document of this type. Under File select Save As Web Page. Follow the dialog prompts.

    Sincerely,
    Leith Ross

+ 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