vba - How do you disable "Save and send" in Excel 2010 (in the File ribbon (called backstage in Office 2010)? -


i have following vba marco running in excel 2003, blocks save, save as, save workspace, send menus need same excel 2010 ?

application.commandbars("worksheet menu bar").controls("file").controls("save as...").enabled = false

application.commandbars("worksheet menu bar").controls("file").controls("save").enabled = false

application.commandbars("worksheet menu bar").controls("file").controls("save workspace...").enabled = false

application.commandbars("worksheet menu bar").controls("file").controls("send to").enabled = false

application.commandbars("worksheet menu bar").controls("format").controls("sheet").enabled = false

there 'new menu' in excel 2010 called "save , send" (under file ribbon) disable... how do ? i’m searching equivalent line one:

'application.commandbars("worksheet menu bar").controls("file").controls("save & send").enabled = false

thank help.

for ribbon ui example/documentation microsoft, here. recommend use customui editor.

open file (which must excel 2007+ file extension xlsx, xlsm, xlam, etc) in customui editor. use xml in editor:

<customui xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <backstage>     <tab idmso="tabshare" visible="false" enabled="false">     </tab> </backstage> </customui> 

save file, , close customui editor.

then, open file. go file/backstage view , should see save , send tab has been removed:

screenshot of disabled tabshare

note: has disabled entire "save & send" tab backstage view. should possible using xml fine-tune this, i.e., enable tab, disable specific controls therein (e.g., maybe want disable send attachment want leave other options enabled, etc.) haven't quite worked out xml hierarchy disable only specific send attachment control.

hope helps!

update comments

1) user find "normal" functionality when file closed, or when file active. ui customization applies file contains custom ui xml parts, if have multiple files open, file affected disabled save & send tab.

2) unfortunately, not compatible excel 2003 or prior. customui/xml not part of legacy xls files, , such, cannot implemented in these versions. 2003/prior versions of excel, have use legacy commandbars can controlled through vba. relatively easy put vba code check version of excel, , run subroutine disable commandbar/controls if user in 2003 or prior versions.

if try save down xls file, receive warning, indicating feature incompatible file type:

customui xml not compatible xls files

additionally, cannot open xls file in customui editor.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -