Show Custom Toolbar on open

G

Guest

I am creating an excel template to be accessed by multiple users on a server.
I have created a custom toolbar with macro buttons and saved them to the
workbook.

I would like the toolbar to display when the new workbook is opened and hide
when it is closed. Is this possible?
 
G

Guest

Open the VBE (Alt+F11) and add an OnOpen and Before Close event:

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Application.CommandBars("Your_ToolBar_Name_Here").Visible = False

End Sub

Private Sub Workbook_Open()

Application.CommandBars("Your_ToolBar_Name_Here").Visible = True

End Sub
 
G

Guest

Thank you so much. That was just what I needed.

Kevin B said:
Open the VBE (Alt+F11) and add an OnOpen and Before Close event:

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Application.CommandBars("Your_ToolBar_Name_Here").Visible = False

End Sub

Private Sub Workbook_Open()

Application.CommandBars("Your_ToolBar_Name_Here").Visible = True

End Sub
 

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