PC Review


Reply
Thread Tools Rate Thread

Assign a Custom Toolbar to only one WorkBook

 
 
Ken Soenen
Guest
Posts: n/a
 
      28th Sep 2005
Need Help:
I am trying to assign a custom toolbar to only one
workbook. The custom toolbar consists of several buttons each of which has a
macros assigned. The macros are such that they only can be used in the one
workbook. I CAN get the toolbar assigned to the workbook I want, but, the
problem is that the toolbar is also assigned to every other existing
workbook???


Any thoughts would be appreciated,
ken


 
Reply With Quote
 
 
 
 
Anne Troy
Guest
Posts: n/a
 
      28th Sep 2005
Ken, the absolute best way to do this is to build the toolbar using VBA.
http://vbaexpress.com/kb/getarticle.php?kb_id=427

************
Anne Troy
www.OfficeArticles.com

"Ken Soenen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Need Help:
> I am trying to assign a custom toolbar to only one
> workbook. The custom toolbar consists of several buttons each of which has
> a macros assigned. The macros are such that they only can be used in the
> one workbook. I CAN get the toolbar assigned to the workbook I want, but,
> the problem is that the toolbar is also assigned to every other existing
> workbook???
>
>
> Any thoughts would be appreciated,
> ken
>



 
Reply With Quote
 
JE McGimpsey
Guest
Posts: n/a
 
      28th Sep 2005
One way:

After attaching the toolbar to your workbook. Put these macros in your
ThisWorkbook code module:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.CommandBars("Custom 1").Delete
On Error GoTo 0
End Sub

Private Sub Workbook_Activate()
On Error Resume Next
With Application.CommandBars("Custom 1")
.Enabled = True
.Visible = True
End With
On Error GoTo 0
End Sub

Private Sub Workbook_Deactivate()
On Error Resume Next
With Application.CommandBars("Custom 1")
.Enabled = False
.Visible = False
End With
On Error GoTo 0
End Sub


In article <(E-Mail Removed)>,
"Ken Soenen" <(E-Mail Removed)> wrote:

> Need Help:
> I am trying to assign a custom toolbar to only one
> workbook. The custom toolbar consists of several buttons each of which has a
> macros assigned. The macros are such that they only can be used in the one
> workbook. I CAN get the toolbar assigned to the workbook I want, but, the
> problem is that the toolbar is also assigned to every other existing
> workbook???
>
>
> Any thoughts would be appreciated,
> ken

 
Reply With Quote
 
JE McGimpsey
Guest
Posts: n/a
 
      28th Sep 2005
That article doesn't seem to have very much to do with the OP's
question. It's an article about how to add a menu item to the menu bar.
Once the item is added, it's available to all open workbooks.

The OP asked about configuring a custom toolbar so that it was only
available to a single workbook.

There's absolutely no need for the toolbar to be built using VBA. While
I tend to build my toolbars that way, there are some disadvantages to
doing so.

In article <#WIbXI$(E-Mail Removed)>,
"Anne Troy" <(E-Mail Removed)> wrote:

> Ken, the absolute best way to do this is to build the toolbar using VBA.
> http://vbaexpress.com/kb/getarticle.php?kb_id=427
>
> ************
> Anne Troy
> www.OfficeArticles.com
>
> "Ken Soenen" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Need Help:
> > I am trying to assign a custom toolbar to only one
> > workbook. The custom toolbar consists of several buttons each of which has
> > a macros assigned. The macros are such that they only can be used in the
> > one workbook. I CAN get the toolbar assigned to the workbook I want, but,
> > the problem is that the toolbar is also assigned to every other existing
> > workbook???
> >
> >
> > Any thoughts would be appreciated,
> > ken
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 - assign macro to custom toolbar button Candace Microsoft Excel Misc 1 10th Aug 2009 12:14 PM
Assign Add-In to Custom Toolbar Button Microsoft Office 2007 britt_04 Microsoft Excel Misc 1 13th Oct 2008 09:57 PM
assign macro to custom toolbar button =?Utf-8?B?Um9kIE5vbGFu?= Microsoft Outlook VBA Programming 1 7th Sep 2006 05:34 AM
Assign macro to toolbar custom button? =?Utf-8?B?YW1lc2NoYQ==?= Microsoft Excel Programming 5 27th Sep 2004 05:31 PM
Assign a Macro to a Custom Toolbar Button =?Utf-8?B?U2hlaWxhIEEuIFJhbms=?= Microsoft Word Document Management 2 4th May 2004 02:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:46 PM.