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 Autpen()
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
Sub Autpen()
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