如何使用XLA文檔爲Excel創建工具欄?如何在XLA文檔中創建工具欄?
2
A
回答
3
要使一個工具欄,在onload事件,你會做這樣的事情:
Dim myBar As CommandBar, myButt As CommandBarControl
'Delete the toolbar if it already exists'
On Error Resume Next
CommandBars("My Toolbar").Delete
On Error Goto 0
Set myBar = CommandBars.Add(Name:="My Toolbar", _
Position:=msoBarFloating, Temporary:=True)
myBar.Visible = True
' Create a button with text on the bar and set some properties.'
Set myButt = ComBar.Controls.Add(Type:=msoControlButton)
With myButt
.Caption = "Macro1"
.Style = msoButtonCaption
.TooltipText = "Run Macro1"
.OnAction = "Macro1"
End With
' Create a button with an image on the bar and set some properties.'
Set myButt = ComBar.Controls.Add(Type:=msoControlButton)
With myButt
'the faceId line will let you choose an icon'
' If you choose to use the faceId then the caption is not displayed'
.FaceId = 1000
.Caption = "Icon Button"
.TooltipText = "Run Macro2"
.OnAction = "Macro2"
End With
禮貌要做的是退出時刪除工具欄,也。
1
+0
謝謝... Excel 2003,但它也應該在2007年。 – Jason 2008-11-04 16:21:59
相關問題
- 1. 在.chm文件中創建工具欄
- 2. 如何在Firefox上創建工具欄?
- 3. 如何在標題欄中創建工具欄?
- 4. 如何在c#中的任務欄上創建工具欄?
- 5. 如何在DHTMLX中創建底部工具欄(狀態欄)?
- 6. 如何在Android中創建傾斜的操作欄(工具欄)?
- 7. 如何爲工具欄創建事件?
- 8. 如何從資源創建工具欄?
- 9. 如何爲IE創建工具欄?
- 10. 如何創建持久工具欄?
- 11. 如何創建此wpf工具欄
- 12. 在xaml中創建下拉工具欄
- 13. 在Adobe Flex中創建工具欄3
- 14. 如何在普通文本框的頂部創建工具欄?
- 15. 如何在片段和活動中創建摺疊工具欄
- 16. 如何查找在DocumentViewer工具欄中創建的控件?
- 17. 如何在Java中創建一個動作條/工具欄
- 18. 如何在CMDIChildWndEx派生的CChildFrame中創建工具欄?
- 19. 如何在Netbeans工具欄中創建自定義按鈕?
- 20. 如何在wpf中創建對接(浮動)工具欄
- 21. 如何在android phonegap中使用jquery mobile創建工具欄?
- 22. 如何在OpenCV中2.4.9創建工具欄使用Qt
- 23. 如何在工具欄中爲GtkToolItem創建監聽器?
- 24. 如何在android ..中創建自定義工具欄?
- 25. 如何在rcp中爲特定視角創建工具欄?
- 26. 如何在Asp.net中創建瀏覽器工具欄
- 27. 如何使用標籤在TableView中創建工具欄?
- 28. JavaFX的:工具欄與如何創建一個工具欄這樣imagebuttons
- 29. 新創建的工具欄圖標不顯示在工具欄中
- 30. 工具欄與類「工具欄底」創建頁面內容
@ BradC - 那裏有趣的變量名稱。 :-) – 2008-11-04 16:24:29