文件名称:EXCEL VBA创建菜单代码
文件大小:12KB
文件格式:TXT
更新时间:2012-10-15 14:58:35
VBA
EXCEL VBA创建菜单的代码 Sub Creatxlsht() On Error Resume Next Application.CommandBars("xlsht").Delete Dim cbrCmdBar As CommandBar Dim strCBarName As String strCBarName = "xlsht" Set cbrCmdBar = Application.CommandBars.Add(Name:=strCBarName, Position:=msoBarPopup) Set SubMenu = CommandBars(strCBarName).Controls.Add(Type:=msoControlButton) With SubMenu .Caption = "数据维护中心" .TooltipText = "aa" .Style = msoButtonIconAndCaption .Tag = "bb" .FaceId = 9588 ' 9949 '2122 '1018 .Enabled = True .OnAction = "k" End With Set SubMenu = CommandBars(strCBarName).Controls.Add(Type:=msoControlButton) With SubMenu .Caption = "显示客户记录" .TooltipText = "aa" .Style = msoButtonIconAndCaption .Tag = "bb" .FaceId = 9584 ' 9949 '2122 '1018 .Enabled = True .OnAction = "xskujl" End With Set SubMenu = CommandBars(strCBarName).Controls.Add(Type:=msoControlButton) With SubMenu .Caption = "删除客户记录" .TooltipText = "aa" .Style = msoButtonIconAndCaption .Tag = "bb" .FaceId = 9585 ' 9949 '2122 '1018 .Enabled = True .OnAction = "Sckujl" End With