+ Reply to Thread
Results 1 to 5 of 5

vba code to get User id or User name who unprotects worksheet

  1. #1
    Forum Contributor prabhuduraraj09's Avatar
    Join Date
    05-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    330

    Post vba code to get User id or User name who unprotects worksheet

    hi friends,

    as always i would need possible help from you guy i

    i have a workbook, in which worksheet is protected. i want to record or to maintain a log whoever unprotects the worksheet.

    i want user id or user name who is applying password to unprotecct the worksheet. i want this log in same workbook or to have it another separate workbook, either way is fine.

    guys help me please!

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: vba code to get User id or User name who unprotects worksheet

    Hi, prabhuduraraj09,

    AFAIR there is no event to be raised when a sheet is protected or unprotected, you would need to add that into the code you use (and that won´t cover the manual alteration).

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor prabhuduraraj09's Avatar
    Join Date
    05-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    330

    Re: vba code to get User id or User name who unprotects worksheet

    hi HaHoBe ,

    Thank you for your Quick response. i am not sure how far it is possible.
    i dont want any changes to be tracked by the user. Just nee the User id to be recorded who is unprotecting the workbook.
    or some logic like "the user id who is making changes after unprotecting ".

    any sample work that you can provide would be much appreciated.

    rest i may try..........

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: vba code to get User id or User name who unprotects worksheet

    Hi, prabhuduraraj09,

    what will happen if the user of the workbook starts the workbook without enabled macros? That´s exactly the part where a macro based solution could fail.

    i am not sure how far it is possible.
    Depending on the version of Office you use you may not only need to use VBA but XML as well to stop users from unportecting worksheets without code.

    Ciao,
    Holger

  5. #5
    Forum Contributor prabhuduraraj09's Avatar
    Join Date
    05-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    330

    Re: vba code to get User id or User name who unprotects worksheet

    Hi HaHoBe,

    The workbook has already a macro for autosave. Users has been informed to have the macro enabled always since users use the same workbook whole day.
    So that wont be a problem.

    Version used is 2003.

    I dont want to stop user....from unprotecting the workbook. I want to know if the user unprotecting the workbook, if yes which users are doing so.

+ 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. [SOLVED] Excel vba user form- open directly to user form not worksheet
    By PANTECH in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 04-24-2013, 05:07 PM
  2. Insert user's name into cell based on windows user login when a button is clicked.
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 08-16-2011, 01:08 PM
  3. Match new password to specific user and update list via custom user form
    By Sargekd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2011, 09:40 AM
  4. Pause macro for user input then search for user's answer across multiple sheets
    By sassy2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-04-2009, 03:55 AM
  5. What code do I use to add a user form to Excel worksheet?
    By Hammer1947 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2006, 01:35 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