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

trellacj

New Member
Joined
Feb 27, 2002
Messages
7
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
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
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).
 
Upvote 0
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!
 
Upvote 0
Re: Disable "File --> Send" on the Menu Bar

;4386 said:
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
 
Upvote 0

Forum statistics

Threads
1,214,631
Messages
6,120,640
Members
448,974
Latest member
DumbFinanceBro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top