Show Custom Toolbar on open

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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
 
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
 
Back
Top