Excel VSTO:切换工作簿时保持显示自定义功能区
我有一个 Vsto Excel 工作簿(在 Visual Studio 中创建),其中还包含自定义功能区。如果我在 Excel (2007) 中加载此工作簿,则仅当我的工作簿具有焦点时才会显示功能区。如果我切换到不同的工作簿,它就会消失。我知道这是设计使然,但是有什么方法可以更改此行为,以便我可以在选择任何工作簿时使用功能区的按钮?
I have a Vsto Excel workbook (created in Visual Studio) which also contains a custom ribbon. If I load this workbook in Excel (2007), the ribbon is only displayed as long as my workbook has focus. It disappears if I switch to a different workbook. I understand this is by design, but is there any way of changing this behavior so that I can use the ribbon's buttons when any workbook is selected?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了拥有Excel范围的功能区,您需要在VS中创建一个“Excel 2007 Add-in”而不是“Excel 2007 Template”或“Excel 2007 Workbook”。
In order to have an Excel-wide ribbon, you need to create an "Excel 2007 Add-in" in VS instead of an "Excel 2007 Template" or "Excel 2007 Workbook".