Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("cell").Reset
End Sub
Private Sub Workbook_Open()
Application.CommandBars("cell").Reset
Set cma = Application.CommandBars("cell").Controls.Add(Type:=msoControlButton, Before:=1)
With cma
.Caption = "设置字体格式和字体颜色"
.OnAction = "字体颜色"
End With
Set cmb = Application.CommandBars("cell").Controls.Add(Type:=msoControlButton, Before:=1)
With cmb
.Caption = "设置单元格格式和填充颜色"
.OnAction = "填充颜色"
End With
End Sub
这个cma和cmb 定义为 CommandBarControl 还是 CommandBarbutton ???