Custom Toolbar

MarkAndrews

Well-known Member
Joined
May 2, 2006
Messages
1,970
Office Version
  1. 2010
Platform
  1. Windows
I've seen this done before - haven't got a clue how tho

Basically, to the left of the up & down page navigation, a custom toolbar (permanently fixed) which has a number of custom macro buttons, which only appear when a specific document is opened

Any idea's how to do it?

TIA
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi Mark

Sorry mate - really don't know what you mean. I've tried it with no problem. You are changing all instances of "Marks Toolbar" in the code aren't you...?

Code:
Sub Test()

Application.ScreenUpdating = False
Application.StatusBar = "Designed By Mark Andrews"
ActiveWorkbook.Save
ActiveWorkbook.RefreshAll
On Error Resume Next
Application.CommandBars("Floccinaucinihilipilification").Delete
On Error GoTo 0
Set TB = Application.CommandBars.Add(Name:="Floccinaucinihilipilification")
Set Btn = TB.Controls.Add(Type:=msoControlButton)
With Btn
.FaceId = 71
.TooltipText = "Marks Button1"
.OnAction = "MarksMacro1"
End With
Set Btn = TB.Controls.Add(Type:=msoControlButton)
With Btn
.FaceId = 72
.TooltipText = "Marks Button1"
.OnAction = "MarksMacro2"
End With
With Application.CommandBars("Floccinaucinihilipilification")
.Visible = True
Application.ScreenUpdating = True
End With
End Sub

HTH

DominicB

EDIT : Not sure if there's any disallowed characters in a toolbar name(???)
 
Upvote 0
Yup, altering all of em

Will give it another try......

Still confused with the anchoring

Is it poss to add another button in too?

TIA :biggrin:
 
Upvote 0
No like?

Code:
Private Sub Workbook_Open()

Application.ScreenUpdating = False
Application.StatusBar = "Designed By Mark Andrews"
ActiveWorkbook.RefreshAll
ActiveWorkbook.Save
On Error Resume Next
Application.CommandBars("Options").Delete
On Error GoTo 0
Set TB = Application.CommandBars.Add(Name:="Options")
Set Btn = TB.Controls.Add(Type:=msoControlButton)
With Btn
.FaceId = 71
.TooltipText = "Marks Button1"
.OnAction = "MarksMacro1"
End With
Set Btn = TB.Controls.Add(Type:=msoControlButton)
With Btn
.FaceId = 72
.TooltipText = "Marks Button1"
.OnAction = "MarksMacro2"
End With
With Application.CommandBars("Options")
.Visible = True
Application.ScreenUpdating = True
End With
End Sub
 
Upvote 0
Hi Mark

The problem is the word "Options". You menu bar "File | Edit etc" is really a toolbar in disguise. And it already has an "Options" under the tools menu. Use another name (even adding say an "-" to the end of options will allow it to be used, try adding a space - "Options ").

For more buttons, add this code each time to add more buttons :

Code:
Set Btn = TB.Controls.Add(Type:=msoControlButton)
With Btn
.FaceId = 72
.TooltipText = "Marks Button3"
.OnAction = "MarksMacro3"
End With

Just remember to change the target macro (OnAction) and the icon picture (FaceID). You're going to ask me about these next aren't you? :biggrin:

HTH

DominicB
 
Upvote 0
Dominic - WTH....? :unsure:

Will rename to something else, thanks mate
 
Upvote 0
Hi Mark

Just knew that one was coming! :LOL:

There are thousands of FaceID pictures available, but you need to be able to see them all so you can choose which one you want. So, you need a FaceID viewer utility. These are usually FOC add-ins, there are a couple of links here that provide them :

http://skp.mvps.org/faceid.htm
http://j-walk.com/ss/excel/tips/faceidgrid.exe

I personally like the one by Jim Cone (you can't download it, he'll only send it via e-mail) - if you want that let me know your e-mail address - but they're all much of a muchness. Anyway, once you start it going, look for FaceID 71 and 72 and you'll see that they relate to large graphical numbers 1 and 2... You get the idea...

HTH

DominicB
 
Upvote 0
Thanks Dominic

Apologies for the delay, been in a project meeting as per PM earlier

M
 
Upvote 0

Forum statistics

Threads
1,217,364
Messages
6,136,117
Members
449,993
Latest member
Sphere2215

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top