+ Reply to Thread
Results 1 to 4 of 4

Filtering a protected WS in a shared workbook - Excel 2000

  1. #1
    Phuong Nguyen
    Guest

    Filtering a protected WS in a shared workbook - Excel 2000

    Hi,

    I am having problem with filtering a protected worksheet in a shared
    workbook. I used the macro below which was provided on this discussion
    group. When I share the workbook and open the file again, I get the
    following error:

    Run-time error '1004':
    Protect method of Worksheet class failed

    Your help is greatly appreciated!
    Phuong

    Private Sub Workbook_Open()
    'check for filter, turn on if none exists
    With Worksheets("Data")
    If Not .AutoFilterMode Then
    .Range("A1").AutoFilter
    End If
    .EnableAutoFilter = True
    .Protect Password:="password", _
    Contents:=True, UserInterfaceOnly:=True
    End With
    End Sub




  2. #2
    Dave Peterson
    Guest

    Re: Filtering a protected WS in a shared workbook - Excel 2000

    I think you've got to make a choice.

    If the workbook is shared, then you can't change the protection of any
    worksheet.

    You can't even change it to allow the code to do the changes
    (Userinterfaceonly:=true).

    So you can unshare it and leave the worksheet protection.

    or...

    You can unprotect the worksheet and leave the workbook shared.



    Phuong Nguyen wrote:
    >
    > Hi,
    >
    > I am having problem with filtering a protected worksheet in a shared
    > workbook. I used the macro below which was provided on this discussion
    > group. When I share the workbook and open the file again, I get the
    > following error:
    >
    > Run-time error '1004':
    > Protect method of Worksheet class failed
    >
    > Your help is greatly appreciated!
    > Phuong
    >
    > Private Sub Workbook_Open()
    > 'check for filter, turn on if none exists
    > With Worksheets("Data")
    > If Not .AutoFilterMode Then
    > .Range("A1").AutoFilter
    > End If
    > .EnableAutoFilter = True
    > .Protect Password:="password", _
    > Contents:=True, UserInterfaceOnly:=True
    > End With
    > End Sub


    --

    Dave Peterson

  3. #3
    Phuong Nguyen
    Guest

    Re: Filtering a protected WS in a shared workbook - Excel 2000

    I am creating this shared workbook with multiple tabs for different groups to
    fill in their data. The master worksheet contains links to other worksheets
    and I'd like them to have the ability to filter but not edit (they must go to
    their own worksheet to edit). Given this scenario, is there a way to protect
    the master worksheet and allow filtering before sharing the workbook?

    Thanks,
    Phuong

    "Dave Peterson" wrote:

    > I think you've got to make a choice.
    >
    > If the workbook is shared, then you can't change the protection of any
    > worksheet.
    >
    > You can't even change it to allow the code to do the changes
    > (Userinterfaceonly:=true).
    >
    > So you can unshare it and leave the worksheet protection.
    >
    > or...
    >
    > You can unprotect the worksheet and leave the workbook shared.
    >
    >
    >
    > Phuong Nguyen wrote:
    > >
    > > Hi,
    > >
    > > I am having problem with filtering a protected worksheet in a shared
    > > workbook. I used the macro below which was provided on this discussion
    > > group. When I share the workbook and open the file again, I get the
    > > following error:
    > >
    > > Run-time error '1004':
    > > Protect method of Worksheet class failed
    > >
    > > Your help is greatly appreciated!
    > > Phuong
    > >
    > > Private Sub Workbook_Open()
    > > 'check for filter, turn on if none exists
    > > With Worksheets("Data")
    > > If Not .AutoFilterMode Then
    > > .Range("A1").AutoFilter
    > > End If
    > > .EnableAutoFilter = True
    > > .Protect Password:="password", _
    > > Contents:=True, UserInterfaceOnly:=True
    > > End With
    > > End Sub

    >
    > --
    >
    > Dave Peterson
    >


  4. #4
    Dave Peterson
    Guest

    Re: Filtering a protected WS in a shared workbook - Excel 2000

    Not that I know.


    Phuong Nguyen wrote:
    >
    > I am creating this shared workbook with multiple tabs for different groups to
    > fill in their data. The master worksheet contains links to other worksheets
    > and I'd like them to have the ability to filter but not edit (they must go to
    > their own worksheet to edit). Given this scenario, is there a way to protect
    > the master worksheet and allow filtering before sharing the workbook?
    >
    > Thanks,
    > Phuong
    >
    > "Dave Peterson" wrote:
    >
    > > I think you've got to make a choice.
    > >
    > > If the workbook is shared, then you can't change the protection of any
    > > worksheet.
    > >
    > > You can't even change it to allow the code to do the changes
    > > (Userinterfaceonly:=true).
    > >
    > > So you can unshare it and leave the worksheet protection.
    > >
    > > or...
    > >
    > > You can unprotect the worksheet and leave the workbook shared.
    > >
    > >
    > >
    > > Phuong Nguyen wrote:
    > > >
    > > > Hi,
    > > >
    > > > I am having problem with filtering a protected worksheet in a shared
    > > > workbook. I used the macro below which was provided on this discussion
    > > > group. When I share the workbook and open the file again, I get the
    > > > following error:
    > > >
    > > > Run-time error '1004':
    > > > Protect method of Worksheet class failed
    > > >
    > > > Your help is greatly appreciated!
    > > > Phuong
    > > >
    > > > Private Sub Workbook_Open()
    > > > 'check for filter, turn on if none exists
    > > > With Worksheets("Data")
    > > > If Not .AutoFilterMode Then
    > > > .Range("A1").AutoFilter
    > > > End If
    > > > .EnableAutoFilter = True
    > > > .Protect Password:="password", _
    > > > Contents:=True, UserInterfaceOnly:=True
    > > > End With
    > > > End Sub

    > >
    > > --
    > >
    > > Dave Peterson
    > >


    --

    Dave Peterson

+ 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