1.代码
Application.CommandBars.Add "InsertPrice", msoBarTop
Application.CommandBars("InsertPrice").Visible = True
Application.CommandBars("InsertPrice").Protection = msoBarNoMove + msoBarNoCustomize
Set Control1 = Application.CommandBars("InsertPrice").Controls.Add(msoControlButton, 1)
Control1.Caption = "数据导入"
Control1.OnAction = "insertData"
Control1.Visible = True
2.手工
Workspace->Customize->MenuBar
Key IN:VBA RUN MAIN(BasMain.checkIn)