+ Reply to Thread
Results 1 to 7 of 7

Autofilter in protected workbook not working

  1. #1
    Rumpa Biswas
    Guest

    Autofilter in protected workbook not working

    Trying to use Autofilter in protected workbook for excel 2000. Used the
    following code.

    Private Sub Workbook_Open()
    Build.Protect password:="AbCd13579", DrawingObjects:=True, _
    contents:=True, Scenarios:=True, _
    userinterfaceonly:=True
    Build.EnableAutoFilter = True
    End Sub

    But getting a runtime error 424 with the message as 'Object Required'.

    Steps I followed are -

    1. Entered VB code, mentioned above, in 'thisworkbook' in VB editor.
    2. Protect workbook with my own options and with password.
    3. Tools --> Share and Protect workbook

    Then I am getting the runtime error while opening the excel again.

    Is there any workaround for this?


  2. #2
    Shailesh Shah
    Guest

    Re: Autofilter in protected workbook not working


    When the sheet object(in your case Build) is not found, you get a
    runtime error 424 with the message as 'Object Required'.

    Check it is a codename or name of worksheet.


    Regards,
    Shah Shailesh
    http://in.geocities.com/shahshaileshs/
    (Excel Add-ins Page)

    *** Sent via Developersdex http://www.developersdex.com ***

  3. #3
    Rumpa Biswas
    Guest

    Re: Autofilter in protected workbook not working

    'Build' is the name of one worksheet. Checked everything. Could not find
    source of problem yet.

    "Shailesh Shah" wrote:

    >
    > When the sheet object(in your case Build) is not found, you get a
    > runtime error 424 with the message as 'Object Required'.
    >
    > Check it is a codename or name of worksheet.
    >
    >
    > Regards,
    > Shah Shailesh
    > http://in.geocities.com/shahshaileshs/
    > (Excel Add-ins Page)
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    >


  4. #4
    sgl
    Guest

    Re: Autofilter in protected workbook not working

    Go to the VBE and in the properties window of the "Build" worksheet and under
    the Name field assign a "Code Name" to the worksheet as "Build". This will
    work now. Otherwise the code you have entered in the Workbook_Open will ask
    you for an Object .... Worksheets("Build") .... which you have not defined

    Regards
    SGL

    "Rumpa Biswas" wrote:

    > 'Build' is the name of one worksheet. Checked everything. Could not find
    > source of problem yet.
    >
    > "Shailesh Shah" wrote:
    >
    > >
    > > When the sheet object(in your case Build) is not found, you get a
    > > runtime error 424 with the message as 'Object Required'.
    > >
    > > Check it is a codename or name of worksheet.
    > >
    > >
    > > Regards,
    > > Shah Shailesh
    > > http://in.geocities.com/shahshaileshs/
    > > (Excel Add-ins Page)
    > >
    > > *** Sent via Developersdex http://www.developersdex.com ***
    > >


  5. #5
    Dave Peterson
    Guest

    Re: Autofilter in protected workbook not working

    The bad news is that if the workbook is shared, then you can't change the
    protection of a worksheet--even just to add userinterfaceonly:=true.

    (after you resolved if "Build" was the code name or should have been
    Worksheets("build").)


    Rumpa Biswas wrote:
    >
    > Trying to use Autofilter in protected workbook for excel 2000. Used the
    > following code.
    >
    > Private Sub Workbook_Open()
    > Build.Protect password:="AbCd13579", DrawingObjects:=True, _
    > contents:=True, Scenarios:=True, _
    > userinterfaceonly:=True
    > Build.EnableAutoFilter = True
    > End Sub
    >
    > But getting a runtime error 424 with the message as 'Object Required'.
    >
    > Steps I followed are -
    >
    > 1. Entered VB code, mentioned above, in 'thisworkbook' in VB editor.
    > 2. Protect workbook with my own options and with password.
    > 3. Tools --> Share and Protect workbook
    >
    > Then I am getting the runtime error while opening the excel again.
    >
    > Is there any workaround for this?


    --

    Dave Peterson

  6. #6
    Rumpa Biswas
    Guest

    Re: Autofilter in protected workbook not working

    Thanks. Thats right. I tried later by removing shared option. At that time
    the VB code didn't return any error.

    So, is it correct that 'Autofilter cannot be used in protected and shared
    workbook in excel 2000'?
    Is there any workaround for this?

    "Dave Peterson" wrote:

    > The bad news is that if the workbook is shared, then you can't change the
    > protection of a worksheet--even just to add userinterfaceonly:=true.
    >
    > (after you resolved if "Build" was the code name or should have been
    > Worksheets("build").)
    >
    >
    > Rumpa Biswas wrote:
    > >
    > > Trying to use Autofilter in protected workbook for excel 2000. Used the
    > > following code.
    > >
    > > Private Sub Workbook_Open()
    > > Build.Protect password:="AbCd13579", DrawingObjects:=True, _
    > > contents:=True, Scenarios:=True, _
    > > userinterfaceonly:=True
    > > Build.EnableAutoFilter = True
    > > End Sub
    > >
    > > But getting a runtime error 424 with the message as 'Object Required'.
    > >
    > > Steps I followed are -
    > >
    > > 1. Entered VB code, mentioned above, in 'thisworkbook' in VB editor.
    > > 2. Protect workbook with my own options and with password.
    > > 3. Tools --> Share and Protect workbook
    > >
    > > Then I am getting the runtime error while opening the excel again.
    > >
    > > Is there any workaround for this?

    >
    > --
    >
    > Dave Peterson
    >


  7. #7
    Dave Peterson
    Guest

    Re: Autofilter in protected workbook not working

    Maybe you could add another worksheet that is nothing but formulas pointing back
    to the protected worksheet.

    Leave that worksheet unprotected and allow filtering there.

    =if('sheet 99'!a1="","",'sheet 99'!a1)

    Drag down and across as far as you need.



    Rumpa Biswas wrote:
    >
    > Thanks. Thats right. I tried later by removing shared option. At that time
    > the VB code didn't return any error.
    >
    > So, is it correct that 'Autofilter cannot be used in protected and shared
    > workbook in excel 2000'?
    > Is there any workaround for this?
    >
    > "Dave Peterson" wrote:
    >
    > > The bad news is that if the workbook is shared, then you can't change the
    > > protection of a worksheet--even just to add userinterfaceonly:=true.
    > >
    > > (after you resolved if "Build" was the code name or should have been
    > > Worksheets("build").)
    > >
    > >
    > > Rumpa Biswas wrote:
    > > >
    > > > Trying to use Autofilter in protected workbook for excel 2000. Used the
    > > > following code.
    > > >
    > > > Private Sub Workbook_Open()
    > > > Build.Protect password:="AbCd13579", DrawingObjects:=True, _
    > > > contents:=True, Scenarios:=True, _
    > > > userinterfaceonly:=True
    > > > Build.EnableAutoFilter = True
    > > > End Sub
    > > >
    > > > But getting a runtime error 424 with the message as 'Object Required'.
    > > >
    > > > Steps I followed are -
    > > >
    > > > 1. Entered VB code, mentioned above, in 'thisworkbook' in VB editor.
    > > > 2. Protect workbook with my own options and with password.
    > > > 3. Tools --> Share and Protect workbook
    > > >
    > > > Then I am getting the runtime error while opening the excel again.
    > > >
    > > > Is there any workaround for this?

    > >
    > > --
    > >
    > > 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