| 
    
     |  | 質問させてください。 右クリックに登録したのですが、
 ファイルを立ち上げるたびに、コマンドバーボタンが
 追加されるます。消すにはどうしたらいいか教えてください。
 
 Private Sub Workbook_Open()
 Dim CB As CommandBar, cbc As CommandBarButton
 Dim xfile As String
 xfile = Dir(Path & "\tes" & "*")
 If xfile <> "" Then
 For Each CB In Application.CommandBars
 If CB.Name = "Cell" Then
 CB.Controls(1).BeginGroup = True
 Set cbc = CB.Controls.Add(Type:=msoControlButton,before:=1)
 With cbc
 .FaceId = 303
 .Caption = "開きま〜す!"
 .Style = msoButtonIconAndCaption
 .OnAction = ThisWorkbook.Name & "!thisworkbook.CellOrange"
 End With
 End If
 Next
 Else: MsgBox "フォルダが見つかりません。"
 End If
 
 Set cbc = Nothing
 End Sub
 
 |  |