LDHYOB版主:
我用了以下层次设置
A
.....A1
B
.....B1
其生成代码如下:
Sub AddCustomMenu() '建立自定义菜单主调程序
Dim cmb As CommandBarControl
Set cmb = AddCustomCommandBarPopup("A")
set cmb=Application.CommandBars("Worksheet Menu Bar").Controls("A")
AddCustomCommandBarItem cmb, "A1","",False,True,0,""
Set cmb = AddCustomCommandBarPopup("B")
set cmb=Application.CommandBars("Worksheet Menu Bar").Controls("A")
AddCustomCommandBarItem cmb, "B1","",False,True,0,""
End Sub
第七行的set cmb=Application.CommandBars("Worksheet Menu Bar").Controls("A")
应为set cmb=Application.CommandBars("Worksheet Menu Bar").Controls("B")才是,是不是我设置错误,请指导一下,谢谢!
[此贴子已经被作者于2005-8-1 8:37:52编辑过] |