如何使用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. 如何在DHTMLX中創建底部工具欄(狀態欄)?
- 3. 如何創建此wpf工具欄
- 4. 如何從資源創建工具欄?
- 5. 如何爲IE創建工具欄?
- 6. 如何創建持久工具欄?
- 7. 在Adobe Flex中創建工具欄3
- 8. 在xaml中創建下拉工具欄
- 9. 如何在普通文本框的頂部創建工具欄?
- 10. 如何在Netbeans工具欄中創建自定義按鈕?
- 11. 如何在wpf中創建對接(浮動)工具欄
- 12. 如何使用標籤在TableView中創建工具欄?
- 13. 如何在CMDIChildWndEx派生的CChildFrame中創建工具欄?
- 14. 如何在android ..中創建自定義工具欄?
- 15. 工具欄與類「工具欄底」創建頁面內容
- 16. 在Eclipse文本編輯器中創建一個工具欄
- 17. 文字未在mfc中創建的工具欄上顯示?
- 18. 如何創建將出現在Eclipse工具提示中的XML模式文檔?
- 19. 如何在Silverlight中創建XML文檔
- 20. 如何在Ant中創建「here文檔」?
- 21. 如何在iCloud Drive中創建文檔?
- 22. 如何在.NET中創建OpenOffice文檔
- 23. 如何在.Net中創建ODS文檔
- 24. 如何在頁面底部創建碼頭類型工具欄?
- 25. 如何創建像JqGrid中的ExtJS Grid工具欄搜索
- 26. 如何爲WPF中的工具欄按鈕創建熱鍵?
- 27. 如何在工具欄包含大圖標的Eclipse RCP應用程序中創建自定義工具欄
- 28. 導航菜單在現有工具欄下創建新工具欄?
- 29. 如何在工具欄
- 30. 使用VBA創建Outlook 2003工具欄
@ BradC - 那裏有趣的變量名稱。 :-) – 2008-11-04 16:24:29