+ Reply to Thread
Results 1 to 5 of 5

VBA to disable "Delete...." on shortcut menu of worksheet tab?

Hybrid View

  1. #1
    Registered User
    Join Date
    02-24-2006
    Posts
    5

    VBA to disable "Delete...." on shortcut menu of worksheet tab?

    I have a spreadsheet where I don't want users to be able to delete a worksheet. How do I code it so that the "Delete..." on the shortcut menu for the worksheet tabs is disabled? I'm thinking that part of the code is:

    .Controls("Delete...").enabled=False


    but can't figure out the rest.

    Thanks for any help!

  2. #2
    Ron de Bruin
    Guest

    Re: VBA to disable "Delete...." on shortcut menu of worksheet tab?

    Use this

    Application.CommandBars("Ply").FindControl(ID:=847).Enabled = False

    See also
    http://www.rondebruin.com/menuid.htm

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Mary Kathryn" <Mary.Kathryn.243n6m_1141398604.0775@excelforum-nospam.com> wrote in message
    news:Mary.Kathryn.243n6m_1141398604.0775@excelforum-nospam.com...
    >
    > I have a spreadsheet where I don't want users to be able to delete a
    > worksheet. How do I code it so that the "Delete..." on the shortcut
    > menu for the worksheet tabs is disabled? I'm thinking that part of the
    > code is:
    >
    > Controls("Delete...").enabled=False
    >
    >
    > but can't figure out the rest.
    >
    > Thanks for any help!
    >
    >
    > --
    > Mary Kathryn
    > ------------------------------------------------------------------------
    > Mary Kathryn's Profile: http://www.excelforum.com/member.php...o&userid=31905
    > View this thread: http://www.excelforum.com/showthread...hreadid=518725
    >




  3. #3
    Registered User
    Join Date
    02-24-2006
    Posts
    5
    That did the trick! I sure do appreciate your help!

  4. #4
    Dave Peterson
    Guest

    Re: VBA to disable "Delete...." on shortcut menu of worksheet tab?

    There's an option to delete sheets under Edit (on the worksheet menubar).

    And the user can just drag that tab to another workbook.

    Just a warning that there are other ways to delete sheets.

    You may want to consider using Tools|Protection|protect workbook and check that
    Structure option. The user won't be able to move/delete/insert/rename/copy any
    of those worksheets.

    Mary Kathryn wrote:
    >
    > I have a spreadsheet where I don't want users to be able to delete a
    > worksheet. How do I code it so that the "Delete..." on the shortcut
    > menu for the worksheet tabs is disabled? I'm thinking that part of the
    > code is:
    >
    > Controls("Delete...").enabled=False
    >
    > but can't figure out the rest.
    >
    > Thanks for any help!
    >
    > --
    > Mary Kathryn
    > ------------------------------------------------------------------------
    > Mary Kathryn's Profile: http://www.excelforum.com/member.php...o&userid=31905
    > View this thread: http://www.excelforum.com/showthread...hreadid=518725


    --

    Dave Peterson

  5. #5
    Registered User
    Join Date
    04-14-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    127

    Re: VBA to disable "Delete...." on shortcut menu of worksheet tab?

    I was googling to find delete sheet in vba & I found this thread a good one.

+ 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