W
wschanks
I have this code, that fails when assinging the first faceID. If I
comment it out it works fine. The other faceID assign without a
problem.
With Application.CommandBars("Worksheet Menu
Bar").Controls("Tools").Controls.Add(Type:=msoControlPopup)
.Caption = conTopMenu
.FaceId = 23
.BeginGroup = True
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Formulas" 'Submenu
With .Controls.Add
.OnAction = ThisWorkbook.FullName & "!" & conUnqCountSub
.FaceId = conUnqCountFaceID
.Caption = conUnqCountCaption
End With
With .Controls.Add
.OnAction = ThisWorkbook.FullName & "!" & conSPSub
.FaceId = conSPFaceID
.Caption = conSPCaption
End With
End With 'End Submenu
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Formatting" 'Submenu
With .Controls.Add
.OnAction = ThisWorkbook.FullName & "!" & conStdFmtSub
.Caption = conStdFmtCaption
End With
End With 'End Submenu
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Cell Manipulation" 'Submenu
With .Controls.Add
.OnAction = ThisWorkbook.FullName & "!" & conClrAposSub
.Caption = conClrAposCaption
End With
With .Controls.Add
.OnAction = ThisWorkbook.FullName & "!" &
conResetLastCellSub
.Caption = conResetLastCellCaption
End With
End With 'End Submenu
With .Controls.Add
.BeginGroup = True
.OnAction = ThisWorkbook.FullName & "!" & conHelpSub
.FaceId = conHelpFaceId
.Caption = conHelpCaption
End With
With .Controls.Add
.OnAction = ThisWorkbook.FullName & "!" & conAboutSub
.FaceId = conAboutFaceId
.Caption = conAboutCaption
End With
End With
comment it out it works fine. The other faceID assign without a
problem.
With Application.CommandBars("Worksheet Menu
Bar").Controls("Tools").Controls.Add(Type:=msoControlPopup)
.Caption = conTopMenu
.FaceId = 23
.BeginGroup = True
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Formulas" 'Submenu
With .Controls.Add
.OnAction = ThisWorkbook.FullName & "!" & conUnqCountSub
.FaceId = conUnqCountFaceID
.Caption = conUnqCountCaption
End With
With .Controls.Add
.OnAction = ThisWorkbook.FullName & "!" & conSPSub
.FaceId = conSPFaceID
.Caption = conSPCaption
End With
End With 'End Submenu
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Formatting" 'Submenu
With .Controls.Add
.OnAction = ThisWorkbook.FullName & "!" & conStdFmtSub
.Caption = conStdFmtCaption
End With
End With 'End Submenu
With .Controls.Add(Type:=msoControlPopup)
.Caption = "Cell Manipulation" 'Submenu
With .Controls.Add
.OnAction = ThisWorkbook.FullName & "!" & conClrAposSub
.Caption = conClrAposCaption
End With
With .Controls.Add
.OnAction = ThisWorkbook.FullName & "!" &
conResetLastCellSub
.Caption = conResetLastCellCaption
End With
End With 'End Submenu
With .Controls.Add
.BeginGroup = True
.OnAction = ThisWorkbook.FullName & "!" & conHelpSub
.FaceId = conHelpFaceId
.Caption = conHelpCaption
End With
With .Controls.Add
.OnAction = ThisWorkbook.FullName & "!" & conAboutSub
.FaceId = conAboutFaceId
.Caption = conAboutCaption
End With
End With