PC Review


Reply
Thread Tools Rate Thread

How can I enable my macro to only open for one particular workbook

 
 
=?Utf-8?B?TmVhbGUgWW9uZGU=?=
Guest
Posts: n/a
 
      6th Aug 2007
I have created an Excel project for my office, and I want to use a navigation
drop-down toolbar, which will allow us to quickly access other sheets in the
workbook.

I have found a great navigation toolbar (created with VB); however, the only
problem is that the navigation toolbar opens for EVERY worksheet. It always
opens up whenever I click "enable macros."

I only want the navigation toolbar to come on for this one workbook. I'm a
newbie with Excel, so I have no idea how to edit the code to make it open for
only one worksheet.

Thanks for your help!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      6th Aug 2007
In your startup template, but workbook code like this:

Private Sub Workbook_Open()

If ActiveWorkbook.Name = "Book2.xls" Then
Application.CommandBars("todo").Visible = True
Else
Application.CommandBars("todo").Visible = False
End If
End Sub


--
Gary''s Student - gsnu200735


"Neale Yonde" wrote:

> I have created an Excel project for my office, and I want to use a navigation
> drop-down toolbar, which will allow us to quickly access other sheets in the
> workbook.
>
> I have found a great navigation toolbar (created with VB); however, the only
> problem is that the navigation toolbar opens for EVERY worksheet. It always
> opens up whenever I click "enable macros."
>
> I only want the navigation toolbar to come on for this one workbook. I'm a
> newbie with Excel, so I have no idea how to edit the code to make it open for
> only one worksheet.
>
> Thanks for your help!

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      6th Aug 2007
Hide it on the Deactivate event for this workbook, unhide on the activate.

Application.Commandbars("name"£).Visible = False 'True

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Neale Yonde" <Neale (E-Mail Removed)> wrote in message
news:E4B681B6-6AE5-4C3D-A6FF-(E-Mail Removed)...
>I have created an Excel project for my office, and I want to use a
>navigation
> drop-down toolbar, which will allow us to quickly access other sheets in
> the
> workbook.
>
> I have found a great navigation toolbar (created with VB); however, the
> only
> problem is that the navigation toolbar opens for EVERY worksheet. It
> always
> opens up whenever I click "enable macros."
>
> I only want the navigation toolbar to come on for this one workbook. I'm a
> newbie with Excel, so I have no idea how to edit the code to make it open
> for
> only one worksheet.
>
> Thanks for your help!



 
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
Macro-enable Workbook Salza Microsoft Excel Discussion 0 8th Apr 2010 06:20 PM
Macro-enable Workbook Salza Microsoft Excel Discussion 3 31st Mar 2010 04:09 PM
enable macro automatically when we open a workbook sam Microsoft Excel Programming 2 4th Aug 2009 05:38 PM
Enable macro message on VBA Workbook Open then macro ends Barb Reinhardt Microsoft Excel Programming 2 15th Jul 2008 03:59 PM
Message to enable macro in workbook when no macro exists Barb Reinhardt Microsoft Excel Discussion 2 5th Jul 2005 04:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:09 PM.