+ Reply to Thread
Results 1 to 3 of 3

VBA to protect specfic objects on a worksheet

  1. #1
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    VBA to protect specfic objects on a worksheet

    Hi,

    I have a spreadsheet that is password protected and has numerous cells which are locked, however, it also has cells that contain comments which we want people to be able to Edit so the "Edit Objects" option is checked.

    The problem is I also have some buttons (shapes, not ActiveXControls) which have various macros assigned to them which the users click to filter, run reports etc.

    The issue is that when I password protect the sheet people can edit my buttons. They have to right click over them to select them but they can then type over and move etc.

    1)Is there a way to protect these specific objects?
    2) If so how would this work? i.e. would it protect them on opening by the user?
    3) Then, how would I, as the designer, then access these objects?

    Thanks
    MissDB

  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: VBA to protect specfic objects on a worksheet

    Good afternoon MissDB

    The only way to protect these objects is using the Review > Protect Sheet function, which will prevent you from entering comments. You are going to have a hard time using VBA to give these items any form of protection against user tinkering.

    A workaround might be to keep the worksheet protection invoked, but have a button, or hot key combination that will allow the user to enter a comment to the currently active cell through an input box or simple userform. The macro would need to collect the comment from the user (via userform / input box), turn off protection, post the comment and then re-protect the sheet.

    Is that acceptable?

    HTH

    DominicB

  3. #3
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: VBA to protect specfic objects on a worksheet

    After a lot of hard work we decided to remove the buttons. We did not have time to look this alternative solution, however it's look a good idea so may use this elsewhere or as part of further development if we get time. Thank you!

+ 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. Excel VBA Email Tabs In Worksheet to specfic emails
    By skate1991 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-10-2015, 08:57 AM
  2. How to protect or lock only a few chards (objects), but not all of them?
    By Fresh-Young-Cheese in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 11-02-2012, 03:50 AM
  3. Protect sheet and edit Objects
    By FrankD10 in forum Excel General
    Replies: 3
    Last Post: 08-06-2012, 04:02 PM
  4. Can I protect activex-objects?
    By Crüe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2011, 01:09 AM
  5. Protect all objects in visible sheets
    By tapapad in forum Excel General
    Replies: 7
    Last Post: 11-14-2008, 04:57 PM
  6. Protect Excel 2000 Objects
    By Rodrigo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-18-2005, 01:05 PM
  7. [SOLVED] Protect Objects so they cannot be resized
    By Carolyn A in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-04-2005, 05: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