+ Reply to Thread
Results 1 to 9 of 9

XL07 Shared Workbook Unprotect Method Failing

  1. #1
    Registered User
    Join Date
    04-16-2009
    Location
    Kilkenny, Ireland.
    MS-Off Ver
    Excel 365
    Posts
    47

    XL07 Shared Workbook Unprotect Method Failing

    Hi,

    Like the new look!

    I have a problem and decided to come here as a first port of call rather than last because this forum has always pointed me in the right direction.

    I have a pretty complex XL07 workbook with many macros which contain functions that require that the target sheets/ranges to which they are applied be unprotected prior to execution (and then re-protected on exit).

    It was always my intention to allow this workbook to be shared out, once the major development wound down but I somehow missed the protection limitation on shared workbooks whereby you can protect all of your required elements etc prior to sharing, but once sharing is enabled, the protection method no longer works.

    So all of my macros are failing to execute: Unprotect method of Worksheet class failing etc, as a result of this limitation.

    As complete removal of protection is not a runnner for obvious reasons, I would really appreciate if anybody could suggest any methodology or programming technique that might be available to overcome this issue.

    Yours in hope
    Orson.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: XL07 Shared Workbook Unprotect Method Failing

    It's not an ideal solution but this will only allow the user to select a cell within the range specified as myTable:

    Please Login or Register  to view this content.
    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    04-16-2009
    Location
    Kilkenny, Ireland.
    MS-Off Ver
    Excel 365
    Posts
    47

    Re: XL07 Shared Workbook Unprotect Method Failing

    Dom,

    Thanks for the quick response, and the interesting suggestion.

    I have a query on the applicability however.

    The bottom line is that I have to assume no access to XL's built-in protect method to protect my data, because my functions within the macros will not operate on protected sheets and shared workbooking will not allow temporary removal of such protection to facilitate macro execution.

    You have specified a method by which only cells witin a defined range can be selected, presumably this range would be analogous to an unprotected range then.

    So how then are the ranges that do require protection afforded this protection in the absence of the XL built-in protect functionality as above?

    I am probably missing something fundamental and would be grateful for further clarification.

    Rgds
    Orson.

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: XL07 Shared Workbook Unprotect Method Failing

    As you say the range that is specified is the equivalent of an unprotected range. This means that the sheet can remain unprotected but the user is unable to select cells outside the specified range to make alterations to them.

    It's not a perfect solution by any means but has worked for me in the past.

    It's another good reason to avoid shared workbooks!!!

  5. #5
    Registered User
    Join Date
    04-16-2009
    Location
    Kilkenny, Ireland.
    MS-Off Ver
    Excel 365
    Posts
    47

    Re: XL07 Shared Workbook Unprotect Method Failing

    Ah got you now Dom, thanks for the clarification, that looks like it could be a runner!

    One more thing if you could:

    One of my sheets in particular has several hundred columns, which will include many non-contiguous column ranges, some of which need to be protected, some not.

    Can the macro be easily amended so as to allow specification of a series of 'unprotected' ranges within the sheet? Or could I go even further and specify a series of ranges within a series of worksheets, all contained within the same macro, or would it be more practical/feasible to have such a macro in place for each individual sheet?

    As a throwaway question possibly not answerable without trying it out, would you anticipate much overhead in terms of speed and responsiveness with such macros in place?

    Many thanks for help
    Orson.

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: XL07 Shared Workbook Unprotect Method Failing

    You can specify non- contiguous ranges like this:

    Please Login or Register  to view this content.
    I can't see performance being effected to any noticeable degree.

    Dom

  7. #7
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: XL07 Shared Workbook Unprotect Method Failing

    There is a flaw I've just thought of that means that the user will be able to select cells outside of the specified range if the select a range of cells with the first cells selected being within the allowed area. Will have to see if can think of a way round that.

  8. #8
    Registered User
    Join Date
    04-16-2009
    Location
    Kilkenny, Ireland.
    MS-Off Ver
    Excel 365
    Posts
    47

    Re: XL07 Shared Workbook Unprotect Method Failing

    Hi Dom,

    Thanks again for response, I have checked it out and it does exactly what it says in the tin. I am not sure whether it will be workable in practice as it does not allow the user to skip over the protected ranges using the arrow keys or carriage return, tab etc. and unobstructed progression from one unprotected field to the next will be an essential component of the data entry process that will be required for the sheets in question.

    I reckon that addressing this issue may be quite complicated though? (Sort of like re-inventing the wheel, would like to avoid sharing myself but I have made a commitment to try my best to implement it).

    Not to worry if things are getting a little complicated, I really appreciate your help to date, and in the absence of any further progress on this, I will leave the problem open in case anybody else has any other suggestions or workarounds.

    Cheers
    Orson.

  9. #9
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: XL07 Shared Workbook Unprotect Method Failing

    I agree it works best on a single contiguous block of data.

    One workaround to the problem I described in my previous post would be to prevent the user selecting more than one cell but you are starting to remove a lot of functionality that the user would expect to have and will probably just end up annoying them.

    I remember when I came across this shared workbook/protection issue first and I found it incredibly frustrating trying to come up with workarounds that didn't ruin the frunctionality of the workbook completely.

    Dom

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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