+ Reply to Thread
Results 1 to 7 of 7

Unprotect sheet in Shared workbook ?

Hybrid View

  1. #1
    Registered User
    Join Date
    11-27-2008
    Location
    UK
    Posts
    14

    Unprotect sheet in Shared workbook ?

    Hi I have a Function that uses the following lines of code (a) on entry to the Function and (b) on exit of the function. The code stops working when I share the workbook it throws this error

    "Unprotect method of WorkSheet class failed"

    (a)ActiveWorkbook.Worksheets("aSheet.xls").Unprotect Password:=aPassword
    (b) ActiveWorkbook.Worksheets("aSheet.xls").Protect Password:=aPassword

    Do I have to change the code when working with a shared workbook ? If so how ?

    Thanks

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    You need to unprotect the sharing first (do you have that password protected also?).
        ActiveWorkbook.UnprotectSharing (PWORD)
    should work where PWORD = your password or leave it out if you're sharing without password. NOTE: there is a bug where you can't use VBA to unprotect the workbook when you're using protected shared. I learned this the hard way. There is no problem with protected worksheets however. Does this help?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    11-27-2008
    Location
    UK
    Posts
    14
    Thanks for response ... it did but unfortunately creates mores problems. I want the tracking history to be kept (feature available from shared workbook), when I unProtect the sharing it wipes this out.

  4. #4
    Registered User
    Join Date
    11-27-2008
    Location
    UK
    Posts
    14
    I actually don't want to use a shared workbook, I just want the track changes functionality that the shared workbook provides.
    Don't suppose you know how i could get track changes without sharing the workbook ?

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Unfortunately the Track changes comes with the Sharing and removing the sharing removes the tracking.

    You could write a macro that
    1. Tracks the changes on a separate worksheet (Excel will name that worksheet "History")
    2. Copy History to a new sheet in another workbook Which you use to keep a running track of your history.
    3. Then continue with your previous history safely preserved.

    Sorry, there's no easy way.

  6. #6
    Registered User
    Join Date
    11-27-2008
    Location
    UK
    Posts
    14
    Found a solution to this here's the link http://www.ozgrid.com/Excel/track-changes.htm

    Thanks

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Hi Cameroni,
    Nice link but I still don't see where it says anything that will help you. What is your solution? I'm curious because I use this feature fairly regularly. Thanks

    Nevermind, just found the link to the Tracking VBA method. Thanks
    Last edited by ChemistB; 01-07-2009 at 12:53 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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