![]() |
Add Toolbar to workbook
Hi There,
I have added a Toolbar ("Sige") to a workbook. How to make this toolbar visible on opening and remove it on closing the workbook. Keeping all the present Toolbars! Brgds Sige |
Add Toolbar to workbook
Use this to call your bar and assign macros to the buttons on it and th one below to remove toolbar! Sub Auto_Open() With Application .CommandBars("YOUR BAR NAME").Visible = True .CommandBars("YOUR BAR NAME").Controls("BUTTON NAME").OnActio = "MACRO NAME" .CommandBars("YOUR BAR NAME").Controls("BUTTON NAME").OnActio = "MACRO NAME" .DisplayFullScreen = False End With End Sub Sub cleanupmenubar() On Error Resume Next Application.CommandBars("YOUR BAR NAME").Controls.Delete On Error GoTo 0 End Sub Untested but should work! Hope this helps! Simo -- Simon Lloy ----------------------------------------------------------------------- Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670 View this thread: http://www.excelforum.com/showthread.php?threadid=47169 |
Add Toolbar to workbook
Hi Simon,
The Loading goes fine ...but the "cleanupmenubar" returns Error: "Method or data member not found" on ".Delete" This works though: Application.CommandBars("UpdateReportName").Visibl e = False Thx, Sige Sub Auto_Open() With Application ..CommandBars("UpdateReportName").Visible = True ..CommandBars("UpdateReportName").Controls("&Excha nge Folder...").OnAction = "ShowDialog" '.CommandBars("UpdateReportName").Controls("&Excha nge Folder...").OnAction = "MACRO NAME" ..DisplayFullScreen = False End With End Sub Sub cleanupmenubar() On Error Resume Next Application.CommandBars("UpdateReportName").Contro ls.Delete On Error GoTo 0 End Sub |
All times are GMT +1. The time now is 02:44 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com