請教大大先進們
跑完下列 製出一個CommandBarControl在命令列中
卻無法呈現 .Caption = "回主選單"
求救
Sub MakeMenu1()
Dim bar As CommandBarControl
Dim NewMenu1 As CommandBarControl
Dim MenuCount As Integer
Dim i As Integer
For Each bar In Application.CommandBars(1).Controls
bar.Visible = False
Next
On Error Resume Next
Application.CommandBars(1).Controls("回主選單").Delete
On Error GoTo 0
MenuCount = Application.CommandBars(1).Controls.Count
Set NewMenu1 = Application.CommandBars(1).Controls.Add(Type:=msoControlButton, before:=MenuCount, Temporary:=True)
With NewMenu1
.Caption = "回主選單"
.OnAction = "myForm1"
End With
End Sub
錯誤在哪?
若欲再增加2個Controls 又如何增寫?作者: GBKEE 時間: 2014-7-15 15:01