Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Attaching a toolbar to a workbook
Hi,
I have a workbook with macros. Now I want a toolbar that appears only when I open that specific workbook and disappears when I close the workbook. I can not make this work as I want so if someone can help me, IŽd be very happy. I am running Excel 2003. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Attaching a toolbar to a workbook
Try something like the following. Put all the code shown below in the
ThisWorkbook code module. Change "MyToolBar" to the name of your command bar name. Private Sub Workbook_Activate() Application.CommandBars("MyToolBar").Visible = True End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.CommandBars("MyToolBar").Delete End Sub Private Sub Workbook_Deactivate() Application.CommandBars("MyToolBar").Visible = False End Sub Private Sub Workbook_Open() Application.CommandBars("MyToolBar").Visible = True End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Prixton" wrote in message ... Hi, I have a workbook with macros. Now I want a toolbar that appears only when I open that specific workbook and disappears when I close the workbook. I can not make this work as I want so if someone can help me, IŽd be very happy. I am running Excel 2003. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Toolbar for a specific workbook | Excel Discussion (Misc queries) | |||
Attaching to an email corrupts workbook | Excel Discussion (Misc queries) | |||
keeping a toolbar attached to a workbook | Excel Discussion (Misc queries) | |||
Workbook Specific Toolbar Menus | Excel Discussion (Misc queries) | |||
Copying a workbook with custom toolbar assigned to a macro | Excel Discussion (Misc queries) |