Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
When building a sub-menu, how can I find out what the <Before variable should be where there may be other Temporary menu items already in the sub menu before this is created - if say I want to have the sub-menu appear just before Paste Special (say), how can I know which number that should be - I am looking for a technique here not just a number for that instance Hope that makes sense (hopefully!) Thanks Tim With Application.CommandBars("Edit").Controls.Add(tempo rary:=True, Befo=9) .Tag = "PasteBanklineStatement" On Error Resume Next .Caption = "Paste Bankline Statement" .OnAction = ThisWorkbook.Name & "!Pasting_Statement" On Error GoTo 0 End With |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tim,
You can use the Index number for the particular menu item... Set objNew = .Controls("Paste &Special...") If Not objNew is Nothing Then lngIndex = objNew.Index Else lngIndex = .Controls.Count + 1 End If Set objNew = .Controls.Add(Type:=msoControlButton, Befo=lngIndex) Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Tim Childs" wrote in message ... Hi When building a sub-menu, how can I find out what the <Before variable should be where there may be other Temporary menu items already in the sub menu before this is created - if say I want to have the sub-menu appear just before Paste Special (say), how can I know which number that should be - I am looking for a technique here not just a number for that instance Hope that makes sense (hopefully!) Thanks Tim With Application.CommandBars("Edit").Controls.Add(tempo rary:=True, Befo=9) .Tag = "PasteBanklineStatement" On Error Resume Next .Caption = "Paste Bankline Statement" .OnAction = ThisWorkbook.Name & "!Pasting_Statement" On Error GoTo 0 End With |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim
many thanks for posting this - it looks to be just what I needed Tim "Jim Cone" wrote in message ... Tim, You can use the Index number for the particular menu item... Set objNew = .Controls("Paste &Special...") If Not objNew is Nothing Then lngIndex = objNew.Index Else lngIndex = .Controls.Count + 1 End If Set objNew = .Controls.Add(Type:=msoControlButton, Befo=lngIndex) Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Tim Childs" wrote in message ... Hi When building a sub-menu, how can I find out what the <Before variable should be where there may be other Temporary menu items already in the sub menu before this is created - if say I want to have the sub-menu appear just before Paste Special (say), how can I know which number that should be - I am looking for a technique here not just a number for that instance Hope that makes sense (hopefully!) Thanks Tim With Application.CommandBars("Edit").Controls.Add(tempo rary:=True, Befo=9) .Tag = "PasteBanklineStatement" On Error Resume Next .Caption = "Paste Bankline Statement" .OnAction = ThisWorkbook.Name & "!Pasting_Statement" On Error GoTo 0 End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Menu items | Excel Discussion (Misc queries) | |||
Understanding Menu Item | Excel Programming | |||
New menu items | Excel Programming | |||
Menu items added with menu item editor in older versions | Excel Discussion (Misc queries) | |||
Sub Menu Items | Excel Programming |