+ Reply to Thread
Results 1 to 7 of 7

UserInterfaceOnly:=True not working?!?!

  1. #1
    Registered User
    Join Date
    01-11-2018
    Location
    Germany
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    3

    UserInterfaceOnly:=True not working?!?!

    Hello everyone,

    I would like to create a checklist that is not allowed to be changed.
    The user has permission to add his own comments in column "F".
    In column "G", the user's name and the date are automatically entered in the cell by double-clicking. The user should not be able to change any other cells.
    For this, I call a macro in "Workbook_Open", which protects all pages.
    Here I work with UserInterfaceOnly:=True -> Changes by macros should be allowed.

    My macros work so far...
    However, AFTER finishing the macros I always get the error: "The cell or chart you're trying to change is on a protected sheet."
    As I said, the macros are executed normally. It looks to me like Excel is doing some kind of validation after the macros, which is causing this error.

    I would be very grateful if someone could take a look at this.
    You can test the whole thing by simply double-clicking in cell G23, for example.

    Regards Michel
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,022

    Re: UserInterfaceOnly:=True not working?!?!

    Welcome to the forum.

    Which version do you have? 16 is not clear - do you mean Excel 2016? Please update your profile. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    01-11-2018
    Location
    Germany
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    3

    Re: UserInterfaceOnly:=True not working?!?!

    Thank you for your answer. I updated my profil.
    Yes, I am using Microsoft Office Professional Plus 2016.
    Regards

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,225

    Re: UserInterfaceOnly:=True not working?!?!

    By default, double-clicking edits the cell. Editing a cell is a user's action, and it is forbidden with a protected sheet. The BeforeDoubleClick event is dispatched when you double-click but before the cell is edited. At this point, the code is being executed, which by using UserInterfaceOnly = True can be executed without any problems (not always, but let's skip this problem). After the execution is finished, an attempt is made to edit the cell, which is already not allowed in the case of a protected sheet.
    A fairly common error. Developers forget to disable the default behavior. Just after
    Please Login or Register  to view this content.
    add
    Please Login or Register  to view this content.
    Artik

  5. #5
    Registered User
    Join Date
    01-11-2018
    Location
    Germany
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    3

    Re: UserInterfaceOnly:=True not working?!?!

    OMG!!!! IT IS WORKING!!!!!!
    I spent more than two weeks here on this problem.
    Asked once and solved in the first answer.
    Thank you so much!!!

  6. #6
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,225

    Re: UserInterfaceOnly:=True not working?!?!

    Quote Originally Posted by tapete86 View Post
    I spent more than two weeks here on this problem.
    But it was not a waste of time. You will surely remember for a long time that you should turn off the default behavior in such cases. This is not just for the BeforeDoubleClick event. Whenever you encounter the Cancel parameter, pay attention to it. But that doesn't mean you should always set Cancel to True.

    Artik

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,022

    Re: UserInterfaceOnly:=True not working?!?!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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] Does UserInterfaceOnly:=True work on closed wb when pasting data to it?
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-28-2021, 02:35 PM
  2. UserInterfaceOnly:=True still giving protected error
    By LukeNZ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2020, 01:22 AM
  3. [SOLVED] UserInterFaceOnly:=True
    By Frigide in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-15-2019, 05:24 AM
  4. Run-time error '1004' despite UserInterfaceOnly = TRUE
    By esbencito in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-10-2018, 06:00 AM
  5. Protect UserInterFaceOnly:=True ONLY to VISIBLE worksheets WITHOUT a password
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-07-2017, 10:20 AM
  6. Worksheet.Protection userinterfaceonly:=true problem
    By Kained in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-23-2009, 04:51 AM
  7. .protect userinterfaceonly:=true not working?
    By dreamz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2006, 07:31 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