ukdane
11-07-2008, 02:55 AM
Hi, New to the forum, looking for help.
I've been having trouble with my toolbar in Excel 2000.
I've created my own toolbar using vba, without too much problem.
However I've come across two problems.
1. I've created a menu bar full of icons, which is great. I even have the ToolTipText working. BUT there are one or two of the buttons, where I need to replace the icon with some text instead. I've tried removing the FaceId, and using the Caption, as seen in the example below:
Set myCommandBarCtl = myBar.Controls.Add(Type:=msoControlButton)
With myCommandBarCtl
.Caption = "Hent"
'.FaceId = 1000
.TooltipText = "Hent data"
.OnAction = "getmydata"
End With
The button is visible, BUT empty. How can I get it to show the caption text?
2. My second problem is a little along the same vein.
This time, I've inserted a PopupControl, to the left of the Edit button on the menu bar.
No problem.
However, I also need to put a button there, so it doesn't popup/dropdown, but actions straight away. I simply replaced the Type:=msoControlPopup with Type:=msoControlButton. And the button works. BUT I then find myself in the same situation as with problem 1, I can only use an icon, and not text to represent the button. So, again, how do I get it to show the button name, instead of the icon picture?
I hope I've explained my problem clearly enough.
Thanks in advance for any help.
Cheers
I've been having trouble with my toolbar in Excel 2000.
I've created my own toolbar using vba, without too much problem.
However I've come across two problems.
1. I've created a menu bar full of icons, which is great. I even have the ToolTipText working. BUT there are one or two of the buttons, where I need to replace the icon with some text instead. I've tried removing the FaceId, and using the Caption, as seen in the example below:
Set myCommandBarCtl = myBar.Controls.Add(Type:=msoControlButton)
With myCommandBarCtl
.Caption = "Hent"
'.FaceId = 1000
.TooltipText = "Hent data"
.OnAction = "getmydata"
End With
The button is visible, BUT empty. How can I get it to show the caption text?
2. My second problem is a little along the same vein.
This time, I've inserted a PopupControl, to the left of the Edit button on the menu bar.
No problem.
However, I also need to put a button there, so it doesn't popup/dropdown, but actions straight away. I simply replaced the Type:=msoControlPopup with Type:=msoControlButton. And the button works. BUT I then find myself in the same situation as with problem 1, I can only use an icon, and not text to represent the button. So, again, how do I get it to show the button name, instead of the icon picture?
I hope I've explained my problem clearly enough.
Thanks in advance for any help.
Cheers