| 
    
     |  | Sub 伝票入力の追加() 'メニューバーに「伝票入力」を追加
 Application.CommandBars("Worksheet Menu Bar").Controls.Add Type:= _
 msoControlPopup, before:=12
 CommandBars("Worksheet Menu Bar").Controls(12).Caption = "伝票入力"
 Application.CommandBars("ユーザー設定のポップアップ 2").Controls.Add Type:= _
 msoControlButton, before:=1
 CommandBars("ユーザー設定のポップアップ 2").Controls(1).Caption = "入金伝票"
 CommandBars("ユーザー設定のポップアップ 2").Controls(1).OnAction = "入金伝票を表示"
 Application.CommandBars("ユーザー設定のポップアップ 2").Controls.Add Type:= _
 msoControlButton, before:=2
 CommandBars("ユーザー設定のポップアップ 2").Controls(2).Caption = "出金伝票"
 CommandBars("ユーザー設定のポップアップ 2").Controls(2).OnAction = "出金伝票を表示"
 Application.CommandBars("ユーザー設定のポップアップ 2").Controls.Add Type:= _
 msoControlButton, before:=3
 CommandBars("ユーザー設定のポップアップ 2").Controls(3).Caption = "振替伝票"
 CommandBars("ユーザー設定のポップアップ 2").Controls(3).OnAction = "振替伝票を表示"
 End Sub
 
 というプログラム文で実行すると5行目から7行目にデバッグがでてとまってしまいます。メニューバーに追加するためのプログラムはどのように直せばいいのですか?回答お願いします。
 
 |  |