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 = "© 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
-----------------------------------------------------------------
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 = "© 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
-----------------------------------------------------------------