VBA 控制功能区?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12005621/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 17:21:05  来源:igfitidea点击:

VBA control over the ribbon?

excel-vbaribbonvbaexcel

提问by Josh

I am in the process of creating a VBA add-in for Excel 2010, and I used the "Custom UI Editor for Microsoft Office" tool to create my own ribbon. However, I would like to give the user the option to load my add-in without displaying the ribbon, or with different parts of the ribbon visible.

我正在为 Excel 2010 创建 VBA 加载项,并使用“ Microsoft Office 自定义 UI 编辑器”工具创建了我自己的功能区。但是,我想让用户选择在不显示功能区或在功能区的不同部分可见的情况下加载我的加载项。

With menus, I know you can completely control them programmatically, but ribbons seem to work differently.

对于菜单,我知道您可以完全以编程方式控制它们,但功能区的工作方式似乎有所不同。

Is there a way in VBA to notload my customUI.xmlribbon tabs on startup?
Is there a way to remove items from (or add items to) these tabs at runtime?

VBA 中有没有办法在customUI.xml启动时加载我的功能区选项卡?
有没有办法在运行时从这些选项卡中删除项目(或向其中添加项目)?

回答by Scott Holtzman

here is a whole slew of help on this subject Awesome Ribbon Help. I think points 2 and 3 are of particular interest to you.

这里有关于这个主题的大量帮助Awesome Ribbon Help。我认为您对第 2 点和第 3 点特别感兴趣。