Add Toolbar to workbook

  • Thread starter Thread starter Sige
  • Start date Start date
S

Sige

Hi There,

I have added a Toolbar ("Sige") to a workbook.

How to make this toolbar visible on opening and remove it on closing
the workbook.

Keeping all the present Toolbars!

Brgds Sige
 
Use this to call your bar and assign macros to the buttons on it and th
one below to remove toolbar!

Sub Auto_Open()
With Application
.CommandBars("YOUR BAR NAME").Visible = True
.CommandBars("YOUR BAR NAME").Controls("BUTTON NAME").OnActio
= "MACRO NAME"
.CommandBars("YOUR BAR NAME").Controls("BUTTON NAME").OnActio
= "MACRO NAME"
.DisplayFullScreen = False
End With
End Sub

Sub cleanupmenubar()
On Error Resume Next
Application.CommandBars("YOUR BAR NAME").Controls.Delete
On Error GoTo 0

End Sub

Untested but should work!

Hope this helps!

Simo
 
Hi Simon,

The Loading goes fine ...but the "cleanupmenubar" returns Error:
"Method or data member not found" on ".Delete"

This works though:
Application.CommandBars("UpdateReportName").Visible = False

Thx, Sige


Sub Auto_Open()
With Application
..CommandBars("UpdateReportName").Visible = True
..CommandBars("UpdateReportName").Controls("&Exchange
Folder...").OnAction = "ShowDialog"
'.CommandBars("UpdateReportName").Controls("&Exchange
Folder...").OnAction = "MACRO NAME"
..DisplayFullScreen = False
End With
End Sub


Sub cleanupmenubar()
On Error Resume Next
Application.CommandBars("UpdateReportName").Controls.Delete

On Error GoTo 0
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

Back
Top