More help with Custom menu's 2 problems!

K

Karoo News

First of all i would like to thank all that have helped so far, you are all
a credit to this news group many thanks...

My next problem is this code did work but now does not. I get no custom menu
but when it did the custom menu displayed no text only Icon's when using
button's, it worked fine with popup's the text was displayed but I only need
button's!


Dim Cbar As CommandBar

Private Sub Workbook_Activate()
With Application
.Caption = " 'ERP Scanner Connected Spreasheet'" _
& " - Created By Neil Atkinson - Workbook Name:"
.OnKey key:="{F1}"
.OnKey key:="{F5}"
.OnKey "^{s}", ""
.OnKey "^{p}", ""
.DisplayFormulaBar = False
End With
Application.OnKey "^{s}", ""
Application.OnKey "^{p}", ""
Application.MoveAfterReturn = True
Application.MoveAfterReturnDirection = xlDown
Worksheets(1).ScrollArea = "B1:B1000"

For Each Cbar In Application.CommandBars
If Cbar.BuiltIn = True Then
Cbar.Enabled = False
End If
Next

Application.CommandBars.DisableCustomize = True

Call MyMenu

End Sub

---------------------------------------------------------------

Sub MyMenu()

On Error Resume Next

Dim myMenuBar As CommandBar
Dim aMenu As Object

Set myMenuBar = CommandBars.Add(Name:="ERP", _
MenuBar:=True, temporary:=True)

With myMenuBar.Controls
Set aMenu = .Add(Type:=msoControlButton, temporary:=True)
aMenu.Caption = "&HANDSETS"
aMenu.TooltipText = "Click to enter Handsets"
aMenu.OnAction = "Handsets"
aMenu.FaceId = 568
End With
With myMenuBar.Controls
Set aMenu = .Add(Type:=msoControlButton, temporary:=True)
aMenu.Caption = "&SIMS"
aMenu.TooltipText = "Click to Enter SIM Cards"
aMenu.OnAction = "SIMS"
End With
With myMenuBar.Controls
Set aMenu = .Add(Type:=msoControlButton, temporary:=True)
aMenu.Caption = "&VOUCHERS"
aMenu.TooltipText = "Click to enter Vouchers"
aMenu.OnAction = "Vocuhers"
aMenu.FaceId = 1826
End With
With myMenuBar.Controls
Set aMenu = .Add(Type:=msoControlButton, temporary:=True)
aMenu.Caption = "&COPY to 'serialno.txt'"
aMenu.TooltipText = "Copy contents to C:/MCL-col/Link/Data location"
aMenu.OnAction = "CopyToSN"
aMenu.FaceId = 270
End With

myMenuBar.Visible = True

End Sub

-----------------------------------------------------------------
 
B

Bob Phillips

I found that explanation very confusing.

Does the menu get created?
Do you want icons, text or both on the buttons?

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
K

Karoo News

Hi the menu does not get created at all, but when it did there was only
icon's and no text.

Rgds
Neil

Bob Phillips said:
I found that explanation very confusing.

Does the menu get created?
Do you want icons, text or both on the buttons?

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top