Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXCEL/VISUAL BASIC BUTTON COLOR 1

Status
Not open for further replies.

grozer

Technical User
Sep 4, 2008
2
US
I am missing something in Microsoft's help. I need to alter the color of a button that appears on an Excel tool bar, and perhaps the font or border color as well. Can someone give me some help? My code that creates the button is below.

Sub Auto_Open()
create_SSOW_toolbar
End Sub

Sub create_SSOW_toolbar()
On Error Resume Next
CommandBars("SSOW").Delete 'S_trock S_heet O_rders W_O, get it?
On Error GoTo 0
Set myTB = CommandBars.Add(Name:="SSOW")
myTB.Visible = True
myTB.Position = msoBarTop
msB = msoControlButton ' B_utton
mBC = msoButtonCaption ' C_aption
Set myCtl = myTB.Controls
iDD = 2950
indx = 0
nl = Chr(10)
indx = indx + 1

Set myICN = myCtl.Add(msB, iDD, indx)
With myICN
.Style = mBC
.OnAction = "ciras_data"
.Caption = "CIRAS DATA"
.TooltipText = "Click this button and the District and Work Center" & nl & _
"will be obtained from the CIRAS Admin I screen." & nl & _
"The Order and RGN cells must already be populated."
End With
indx = indx + 1
Set myICN = myCtl.Add(msB, iDD, indx)
With myICN
.Style = mBC
.OnAction = "wt_data"
.Caption = "WEB TIME DATA"
.TooltipText = "Click this button and the WO NUMBER (Work Order), BU (Business Unit)" & nl & _
"COST CTR, SHIP TO OFFICE and SHIP TO PREMISE cells will be populated" & nl & _
"with data obtained from the CLLI CODE NATIONAL_Working COPY.xls" & nl & _
"Excel file. WORK CENTER must already be populated."
End With
rite = reor(5)
Cells(1, rite + 1).Clear
Cells(1, rite + 2).Clear
End Sub



 
grozer...

Hi there from an ex-telephone grunt! (the CIRAS and CILLI
codes gave it away.) :)

I did a pretty exhaustive search for you and it appears the
only thing you can do is add a picture or icon to the button. "Face" won't do it, but I have learned alot about
toolbar buttons, so thanks for your question...!

The only event it has is click, and tool-tips really...

I think unless you invade a .dll somewhere, you're pretty well stuck with what you have now...

John
 
Thank You for your reply DocJohn52!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top