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

G

Guest

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!
 
G

Guest

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
 
B

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top