Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
More help with Custom menu's 2 problems!
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 ----------------------------------------------------------------- |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
More help with Custom menu's 2 problems!
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) "Karoo News" wrote in message ... 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 ----------------------------------------------------------------- |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
More help with Custom menu's 2 problems!
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" wrote in message ... 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) "Karoo News" wrote in message ... 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 ----------------------------------------------------------------- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Picture problems in custom header | Excel Discussion (Misc queries) | |||
Custom Menu's | Excel Discussion (Misc queries) | |||
Custom menu problems | Excel Programming | |||
Custom function problems | Excel Programming | |||
Custom menu's | Excel Programming |