Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Disable "File --> Send" on the Menu Bar

  1. #1
    New Member
    Join Date
    Feb 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    For any given file, when it is open, how do I disable the "Send" option in "File" on the Menu bar? Possibly, in code on the "Open" event? I can't figure it out.

    [ This Message was edited by: trellacj on 2002-02-28 10:01 ]

    [ This Message was edited by: trellacj on 2002-02-28 10:02 ]

  2. #2
    Guest

    Default

    trellacj,

    Place the following code into the "Thisworkbook" object:

    Private Sub Workbook_Open()
    Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Send To").Enabled = False
    End Sub

    and to restore:

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    ThisWorkbook.Save
    Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Send To").Enabled = True
    End Sub

    Whenever the workbook is opened, it disables (grays out) the "Send To" option from the "File" Menu, and when closed, restores it. If you want to remove the command completely, just replace .Enabled with .Visible in both procedures. Hope it helps.

    Aloha!

    p.s. don't remove the workbook.save line on before close event; if you do, the user can defeat your code by making changes to the workbook, closing, then selecting "cancel "when asked to save changes--(the before close event will fire and restore the menu command if this occurs).

  3. #3
    New Member
    Join Date
    Feb 2002
    Location
    ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
    Posts
    48
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    p.p.s.
    Dear Mr. Excel,

    I really love the new message board. The old one was already great, and this one tops the old one! I just wanted to let you know that this is the second time that I logged in and somehow got logged out (posted as anonymous). Yes, I logged in both times with the checkbox "Keep me logged in" checked. Just letting you know. Mahalo!

  4. #4

    Join Date
    Sep 2008
    Posts
    163
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Disable "File --> Send" on the Menu Bar

    Quote Originally Posted by ;4386
    trellacj,

    Place the following code into the "Thisworkbook" object:

    Private Sub Workbook_Open()
    Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Send To").Enabled = False
    End Sub

    and to restore:

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    ThisWorkbook.Save
    Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Send To").Enabled = True
    End Sub

    Whenever the workbook is opened, it disables (grays out) the "Send To" option from the "File" Menu, and when closed, restores it. If you want to remove the command completely, just replace .Enabled with .Visible in both procedures. Hope it helps.
    Hello, I was looking at this code and it seems to do what I want perfectly...although if the user was to show the "Reviewing" toolbar, the option to send mail is still enabled and visible. Is there a way to "grey this out" as well.

    P.S. I do not want this to have permanent effect's on people's machines. Only whilst they are using my workbook.

    Any help is appreciated,

    Thanks in advance

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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