Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Disable Enter new worksheet? (Excel 2002/2003)

    Hi

    I am trying to prevent users from inserting a new worksheet.

    I have tried this, Application.CommandBars("Sheet1").Controls(4).Enab led = False in the workbook open event, but it does not work.

    Any Ideas Please.

    Braddy
    If you are a fool at forty, you will always be a fool

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Disable Enter new worksheet? (Excel 2002/2003)

    CommandBars("Sheet1") makes no sense, unless you have explicitly created a custom toolbar named Sheet1 - a worksheet is not a command bar.

    Try

    CommandBars.FindControl(ID:=852).Enabled = False
    CommandBars.FindControl(ID:=945).Enabled = False

    The first line disables the Insert | Worksheet menu item, and the second one the Insert... item in the right-click menu of worksheet tabs.

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Disable Enter new worksheet? (Excel 2002/2003)

    Hi Hans

    Thank you for the prompt reply, and the solution.

    Regards

    Braddy
    If you are a fool at forty, you will always be a fool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •