大鳥的學(xué)習(xí)樂(lè)園
          路漫漫其修遠(yuǎn)兮,吾將上下而求索
          posts - 26,comments - 27,trackbacks - 0

           

          Private Sub Workbook_Open()

              Dim cbr As CommandBar
              Dim ctrMenu As CommandBarControl
              Dim ctr As CommandBarControl
             
              Set cbr = Application.CommandBars("Worksheet Menu Bar")
             
              For Each ctr In cbr.Controls
             
                  If ctr.Caption = "custom" Then
                      Exit Sub
                  End If
             
              Next
             
             
              Set ctlMenu = cbr.Controls.Add(Type:=msoControlPopup)
             
              With ctlMenu
                     .Caption = "custom"
                      With .Controls.Add(Type:=msoControlButton)
                          .Caption = "aa"
                          .OnAction = "action1"
                      End With
                      With .Controls.Add(Type:=msoControlButton)
                          .Caption = "bb"
                        
                          .OnAction = "action2"
                      End With
              End With
             
          End Sub

          posted on 2009-08-13 15:25 大鳥 閱讀(235) 評(píng)論(0)  編輯  收藏 所屬分類: VBA
          主站蜘蛛池模板: 梨树县| 定陶县| 汽车| 山阴县| 博乐市| 沙洋县| 洪江市| 通化市| 台前县| 安陆市| 柞水县| 左权县| 济宁市| 高唐县| 延川县| 江川县| 剑川县| 沙雅县| 云安县| 新建县| 定州市| 金塔县| 崇州市| 闵行区| 旬邑县| 新昌县| 桃园县| 电白县| 肃宁县| 民乐县| 涞水县| 荆门市| 筠连县| 友谊县| 鹤山市| 永州市| 东兰县| 古丈县| 雅安市| 谷城县| 淮阳县|