|
こんにちは。
こんな感じに、直接処理しても良いんじゃないかなと思います?
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.CommandBars("cell").Controls("開きま〜す!").Delete
End Sub
Private Sub Workbook_Open()
Dim cbc As Object
Set cbc = Application.CommandBars("cell").Controls.Add _
(Type:=msoControlButton, before:=1) ', temporary:=True)
With cbc
.FaceId = 303
.Caption = "開きま〜す!"
.Style = msoButtonIconAndCaption
.OnAction = ThisWorkbook.Name & "!thisworkbook.CellOrange"
.BeginGroup = True
End With
Set cbc = Nothing
End Sub
|
|