Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Toolbar for a specific workbook Prixton Excel Discussion (Misc queries) 8 February 23rd 07 04:44 PM
Attaching to an email corrupts workbook edger Excel Discussion (Misc queries) 1 February 10th 06 10:36 PM
keeping a toolbar attached to a workbook Paul Ponzelli Excel Discussion (Misc queries) 0 August 12th 05 11:39 PM
Workbook Specific Toolbar Menus sjschmidtky Excel Discussion (Misc queries) 1 July 25th 05 04:53 PM
Copying a workbook with custom toolbar assigned to a macro Matt W Excel Discussion (Misc queries) 1 February 4th 05 10:46 PM


All times are GMT +1. The time now is 03:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"