+ Reply to Thread
Results 1 to 3 of 3

Enabling vba-autofilters on a protected AND shared workbook

  1. #1
    Registered User
    Join Date
    04-02-2013
    Location
    Japan
    MS-Off Ver
    Excel 2010
    Posts
    6

    Post Enabling vba-autofilters on a protected AND shared workbook

    Hello all,

    I'm having a strong problem with a workbook I need to save in both shared (MultiUserEditing = True) and protected state. In such a workbook I need to run some vba macros to activate or inhibit some auto-filters...

    The solution on a non-shared workbook is quite simple: simply protect the worksheet HMI with
    Please Login or Register  to view this content.
    and it's done... Almost done, because the UserInterfaceOnly attribute is not saved! (Don't ask me why, but this is explicitly stated in the Worksheet.Protect help). Thus, it shall be re-applied when the workbook is opened (like wks.Protect UserInterfaceOnly:=True in the Workbook_Open callback) in order to get the same protection behaviour and having my auto filters working well with my macros.
    A bit complex, but that's fine however.

    BUT when the workbook is protected, then shared, it's pretty different ! Indeed, (0) on a shared workbook, the protection cannot be changed. This means that when I save my workbook, (1) I loose the UserInterfaceOnly:=True attribute of the protection and when I reopen it later, (2) I cannot restore it because the workbook is shared (thus protection cannot be modified)...

    I feel a bit tricked with circling problem... (0) prevents me to restore the protect UserInterfaceOnly attribute but (0) doesn't prevent that attribute to be lost...

    Any advice ?
    Thanks !

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,621

    Re: Enabling vba-autofilters on a protected AND shared workbook

    You cannot protect or unprotect a worksheet in a shared workbook.

    http://office.microsoft.com/en-us/ex...010342985.aspx


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    04-02-2013
    Location
    Japan
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Enabling vba-autofilters on a protected AND shared workbook

    Hi TMS,

    I know that, this is the statement "(0)" in my post.

    But it's really confusing that on a protected workbook (with UserInterfaceOnly set to True) which is later shared then saved, the UserInterfaceOnly attribute of the protection that was True is turned to False automatically !!
    Here even the wbk is shared, excel itself changes the protection attributes at saving .... I wonder why !? And this is my blocking point....

    Alexandre

+ 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. Macro to open a "Protected View" workbook and enabling edit
    By WaqasTariq in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-13-2013, 05:25 PM
  2. Macro run error in a shared & protected workbook
    By thuddleston11 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-05-2012, 01:53 PM
  3. Shared and Protected Workbook
    By ewan1979 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-19-2011, 02:26 AM
  4. Help with a protected shared workbook
    By ChuckF in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-23-2006, 11:25 AM
  5. [SOLVED] Shared workbook and autofilters
    By Craig Fredona in forum Excel General
    Replies: 0
    Last Post: 04-06-2006, 04:30 PM

Tags for this Thread

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