Send" on the Menu Bar, excel,office,vba,consulting" /> Send" on the Menu Bar Excel Questions" />
![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 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 ] |
|
|
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 |
|
New Member
Join Date: Feb 2002
Location: ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
Posts: 48
|
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 | |
|
Board Regular
Join Date: Sep 2008
Location: Jersey, Channel Islands
Posts: 163
|
Quote:
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
__________________
Regards, Katie Don't look where you fell, but where you slipped. |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|