+ Reply to Thread
Results 1 to 11 of 11

How to create a comment box when the sheet is protected, as insert button is greyed out?

  1. #1
    Registered User
    Join Date
    05-14-2018
    Location
    Europe
    MS-Off Ver
    2016 64 bit
    Posts
    18

    How to create a comment box when the sheet is protected, as insert button is greyed out?

    How can I create, add, edit and remove a comment box using coding, when the sheet is in protected mode.

    Presently, in protected mode the insert comment option is greyed out not allowing me to add comments when the sheet is protected. The spreadsheets need to stay in protected mode (with only a few specific cells unlocked) as I will not be the only person using it. The 'Edit Object' boxes also need to remain unchecked when the sheets are protected.

    Can someone provide me with the correct coding as to how to do this please, and/or also specify why the below codes do not work?

    I'm using Excel 2016.

    Thank you.




    INSERT COMMENT CODE:


    Please Login or Register  to view this content.


    EDIT, ADD, DELETE COMMENT CODE:


    Please Login or Register  to view this content.


    REMOVE COMMENT CODE:


    Please Login or Register  to view this content.
    Last edited by Excel-7878; 05-20-2018 at 03:03 AM.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: How to create a comment box when the sheet is protected, as insert button is greyed ou

    Good morning Excel-7878

    If you want someone to look at some code, then paste it into your main question, using the # button to place code tags around it - as you have supplied it, it is virtually unreadable in a Word document.

    You are correct in that it is not possible to add a comment whilst sheet is protected, however you can edit a comment whilst it is unprotected.
    This is perfect territory for the macro recorder. Just record your actions for unprotecting a sheet, inserting a comment, then re-protect it again.
    If you have ever seen other files insert a comment into a protected sheet, then this is how it's done.

    If you need further assistance, post your recorded code up here, and someone will take a look.

    HTH

    DominicB

  3. #3
    Registered User
    Join Date
    05-14-2018
    Location
    Europe
    MS-Off Ver
    2016 64 bit
    Posts
    18

    Re: How to create a comment box when the sheet is protected, as insert button is greyed ou

    Thanks, I'll try to repost with the # now..

    The spreadsheet actually needs to stay in protected mode (with only a few cells unlocked) as I will not be the only person using it.


    Any advice would be great?

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: How to create a comment box when the sheet is protected, as insert button is greyed ou

    Hi Excel-7878

    Thanks for posting the code - this is much better to read.

    You're going to have to spell out what the issue is - you're asking for code, and then providing code.
    You say that the worksheet is to remain protected, but my proposed solution is to leave it unlocked only long enough for the comment to be put in place.

    In your "edit add, delete comment code" section the password needs to be in quotes - you've done this on the insert comment code, while the remove comment code doesn't unprotect the sheet, so shouldn't work.

    Can you upload a workbook with this code in place - you can delete all the information, just leave a few rows of dummy information so I can see what you're trying to achieve.

    HTH

    DominicB

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to create a comment box when the sheet is protected, as insert button is greyed ou

    If you want to process protected sheets with a macro you must add the parameter UserInterfaceOnly:=True when protecting the sheet, this can only be done using vba to protect the worksheet, I suggest you place this in the worksheet_Activate event
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to create a comment box when the sheet is protected, as insert button is greyed ou

    Please Login or Register  to view this content.
    Last edited by Keebellah; 05-20-2018 at 02:24 AM. Reason: type oooo

  7. #7
    Registered User
    Join Date
    05-14-2018
    Location
    Europe
    MS-Off Ver
    2016 64 bit
    Posts
    18

    Re: How to create a comment box when the sheet is protected, as insert button is greyed ou

    I have created a class attendance sheet that has different coding and features in there, which I will be sharing with staff. The worksheet and individual sheets will need to remain protected/locked when I share it so that staff do not alter the coding/features etc; with the exception of a few unlocked cells that they can type into.

    Because the staff won't have the password to unlock the protected worksheets themselves, they will need an alternative way to make 'additional' comments inside certain cells. I.e. on an unlock sheet they can usually right clicked on the mouse button and select 'insert comment' to make a comment.

    However, because the sheets will be locked and they won't personally be able to unlock the sheets, they will need an alternative way to make comments because the above option is not accessible on a 'protected/locked' sheet.

    I managed to research and find the above mentioned coding, however I could not get it working. I have added the quote marks around the 'dummy' password as suggested, but for some reason I am still unable to make a comment; or figure out how I am suppose to add, edit or delete the comment to be precise.

    If any one has any advice on the above code, or even an alternative code that will allow me to add, edit and remove comments in protected cells automatically that would be great.

    Thank you.

  8. #8
    Registered User
    Join Date
    05-14-2018
    Location
    Europe
    MS-Off Ver
    2016 64 bit
    Posts
    18

    Re: How to create a comment box when the sheet is protected, as insert button is greyed ou

    Please refer to worksheet via link below.
    Last edited by Excel-7878; 05-22-2018 at 09:39 AM.

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to create a comment box when the sheet is protected, as insert button is greyed ou

    The file you attached refers to a for us non-existing file which probably serves as your datapicker (based on the name). samradapps_datepicker.xlam. If you attach files make sure they work. don't send us on a wild-goose-chase.
    Further more, your vba is password protected, very fine. Sure, I can crack it but that's not the way this works,
    Sorry, no go for now.

  10. #10
    Registered User
    Join Date
    05-14-2018
    Location
    Europe
    MS-Off Ver
    2016 64 bit
    Posts
    18

    Re: How to create a comment box when the sheet is protected, as insert button is greyed ou

    If there is a similar functioning Excel calendar available, that also looks as snazzy, I know not where/how to locate it at this stage, hence the date picker I'm currently using provided by a lovely chap named Sam. If you know of an alternative working excel method (that can go with my spreadsheet colour), please do let me know.

    Yes, you're right, in all the commotion in attempting to work through this issue, I skipped the 'coding protection part', clearly... It is now unlocked for your perusal.

    Thanks!




    Spreadsheet: http://we.tl/qQqM0NpOaB

    Date Picker: http://samradapps.com/datepicker/
    Last edited by Excel-7878; 05-27-2018 at 01:49 AM.

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to create a comment box when the sheet is protected, as insert button is greyed ou

    I'll check and see

+ 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. Replies: 2
    Last Post: 11-16-2012, 04:35 AM
  2. Replies: 3
    Last Post: 09-26-2012, 06:17 AM
  3. Insert cell comment on a protected sheet
    By LAF in forum Excel General
    Replies: 4
    Last Post: 07-22-2009, 05:49 AM
  4. create button greyed in macro dialogue
    By telstrareg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-23-2008, 09:25 PM
  5. Replies: 1
    Last Post: 07-25-2006, 08:20 AM
  6. [SOLVED] can you insert a comment into a protected worksheet?
    By TKGerdie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-18-2005, 12:05 PM
  7. Insert comment in protected worksheet
    By The Tuner in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 07:05 AM
  8. Replies: 0
    Last Post: 05-18-2005, 08:06 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