Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Positioning custom menu

I found some great code from Patrick Molloy for the above, controlled by
Workbook_Activate. Under normal circumstances it would place a new menu
before the Help menu, however I have (and others may also have) custom items
on the menu bar. I believe the section that controls the positioning is -

With CommandBars("Worksheet Menu Bar")
Set cmd = .Controls.Add(msoControlPopup, _
befo=.Controls.Count, _
temporary:=True)
End With
cmd.Visible = True

, presumably the "befo=.Controls.Count" bit, ie: one before however many
menu bar items there are.

Is there a way Excel can determine the actual number position of the Help
menu in the bar and place it there minus one?

TIA,
Andy


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Positioning custom menu

Andy,

Here is some code that might help

Set HelpMenu = CommandBars(1).FindControl(ID:=30010)
Set oMenu = Application.CommandBars("Worksheet Menu
Bar").Controls.Add(Type:= _
msoControlPopup, Befo=HelpMenu.Index, Temporary:=True)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Andy Brown" wrote in message
...
I found some great code from Patrick Molloy for the above, controlled by
Workbook_Activate. Under normal circumstances it would place a new menu
before the Help menu, however I have (and others may also have) custom

items
on the menu bar. I believe the section that controls the positioning is -

With CommandBars("Worksheet Menu Bar")
Set cmd = .Controls.Add(msoControlPopup, _
befo=.Controls.Count, _
temporary:=True)
End With
cmd.Visible = True

, presumably the "befo=.Controls.Count" bit, ie: one before however

many
menu bar items there are.

Is there a way Excel can determine the actual number position of the Help
menu in the bar and place it there minus one?

TIA,
Andy




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Positioning custom menu

Here is some code that might help

Thanks Bob. That was definitely on the right track, unfortunately I couldn't
get it going in tandem with what I had from Patrick.

Rgds,
Andy


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Positioning custom menu

Andy,

Post a follow-up with the extra details.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Andy Brown" wrote in message
...
Here is some code that might help


Thanks Bob. That was definitely on the right track, unfortunately I

couldn't
get it going in tandem with what I had from Patrick.

Rgds,
Andy




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Positioning custom menu

Post a follow-up with the extra details.

Bob, that may well just confuse things. The code you supplied works fine,
inasmuchas adds a new menu item before Help. All I need now is the syntax to
refer to it for the purpose of naming it, adding items to it, etc.

Rgds,
Andy




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Positioning custom menu

Andy,

In my example, you refer to it through the oMenu object variable.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Andy Brown" wrote in message
...
Post a follow-up with the extra details.


Bob, that may well just confuse things. The code you supplied works fine,
inasmuchas adds a new menu item before Help. All I need now is the syntax

to
refer to it for the purpose of naming it, adding items to it, etc.

Rgds,
Andy




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Positioning custom menu

the oMenu object variable.

OK, I swear yesterday I had "With oMenu, blah blah" and all it did was fall
over. But today it's captioned & running.

TVM for sticking with, you're a star.

Rgds,
Andy


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom menu winqan Excel Discussion (Misc queries) 1 February 6th 06 10:51 AM
Custom Menu Help EAB1977 Excel Worksheet Functions 1 November 12th 05 01:02 AM
Custom menu Alan M Excel Worksheet Functions 4 September 18th 05 11:57 PM
Custom Menu Luis Excel Programming 1 December 12th 03 01:54 PM
Custom Menu ewize1 Excel Programming 2 October 30th 03 05:16 PM


All times are GMT +1. The time now is 06:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"