在 Excel 共享加载项的现有菜单中创建子菜单
我正在开发一个 Excel 共享加载项,其中有一个名为 Custom
的菜单,该菜单是使用 Excel 宏创建的。现在我想使用 Csharp Shared Add-in 在 Custom
菜单下创建一个子菜单。我使用下面的代码来执行此操作,但没有帮助
oStandardBar = oCommandBars["Custom"];
oCmdBarCtrl = oStandardBar.Controls.Add(MsoControlType.msoControlPopup, Type.Missing, Type.Missing, Type.Missing, true);
oCmdBarCtrl.Visible = false;
oCmdBarCtrl.Caption = "Sub Menu1";
,但它不会创建子菜单,就好像我用“帮助”代替“自定义”一样,我创建了菜单。有什么解决方法吗?
I am developing a Excel shared Add-in which has the menu called Custom
which is created using Excel Macros. Now i want to create a submenu under the Custom
menu using Csharp Shared Add -in. Iam using the below code for doing this but no help
oStandardBar = oCommandBars["Custom"];
oCmdBarCtrl = oStandardBar.Controls.Add(MsoControlType.msoControlPopup, Type.Missing, Type.Missing, Type.Missing, true);
oCmdBarCtrl.Visible = false;
oCmdBarCtrl.Caption = "Sub Menu1";
But it does not create a submenu, where as if i give "Help" in place of Custom i get the menu created. any work around for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个可以帮助您的快速示例:
Here's a quick sample to help you on your way: