G
Gixxer_J_97
Hi all,
i'm getting an 'object doesn't support this property or method' error when
the code runs.
it's erroring on the '.style=' line in the 'with NewMenu' section
not sure what i'm missing....
i'm using the following code to create my custom toolbar:
With Application
.ScreenUpdating = False
Arr1 = Array("Save Order", "Open Order", "Cancel Order", "Reset
Order", "Print..")
Arr2 = Array("SaveOrder", "OpenOrder", "CancelOrder", "ResetOrder",
"PrintDocuments")
Arr3 = Array(100, 101, 102, 103, 104)
Set CBAR = .CommandBars.Add("Tool Box", temporary:=True)
Set NewMenu = CBAR.Controls.Add(msoControlPopup)
With NewMenu
.Caption = "Order Tools"
.TooltipText = "Order Entry Tools"
'.Style = msoButtonIconAndCaption
'.FaceId = 100
End With
For i = 0 To UBound(Arr1)
Set MenuItm = NewMenu.Controls.Add
With MenuItm
.Caption = Arr1(i)
.Style = msoButtonIconAndCaption
.OnAction = Arr2(i)
.FaceId = Arr3(i)
.Width = widths
End With
Next
CBAR.Visible = True
DoEvents
.ScreenUpdating = True
End With
tia!
J
i'm getting an 'object doesn't support this property or method' error when
the code runs.
it's erroring on the '.style=' line in the 'with NewMenu' section
not sure what i'm missing....
i'm using the following code to create my custom toolbar:
With Application
.ScreenUpdating = False
Arr1 = Array("Save Order", "Open Order", "Cancel Order", "Reset
Order", "Print..")
Arr2 = Array("SaveOrder", "OpenOrder", "CancelOrder", "ResetOrder",
"PrintDocuments")
Arr3 = Array(100, 101, 102, 103, 104)
Set CBAR = .CommandBars.Add("Tool Box", temporary:=True)
Set NewMenu = CBAR.Controls.Add(msoControlPopup)
With NewMenu
.Caption = "Order Tools"
.TooltipText = "Order Entry Tools"
'.Style = msoButtonIconAndCaption
'.FaceId = 100
End With
For i = 0 To UBound(Arr1)
Set MenuItm = NewMenu.Controls.Add
With MenuItm
.Caption = Arr1(i)
.Style = msoButtonIconAndCaption
.OnAction = Arr2(i)
.FaceId = Arr3(i)
.Width = widths
End With
Next
CBAR.Visible = True
DoEvents
.ScreenUpdating = True
End With
tia!
J