View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
pjbur2005 via OfficeKB.com pjbur2005 via OfficeKB.com is offline
external usenet poster
 
Posts: 19
Default cmdbarmenu focus problem

Dear all,

I have a complex form using Excel, the processes on the form all work well.
I have removedmenu bar items that are not required and added ones of my own
to manage how users use the form. This enables actions that are required and
disables actions that are not.

My problem is that when a user activates acell or range on the form and then
goes to use one of the menu bar items it does not work. They have to release
the cell first. Is there a way of taking focus from the cell and ensuring
that the menu bar item gets it and the on action then works?

Here is the code I use to set the items (this is one of about 5)

Set CmdBarMenu = CmdBar.Controls.Add(Type:=msoControlPopup, befo=hindex)
CmdBarMenu.Caption = "&Refresh Form"
CmdBarMenu.OnAction = "'" & ThisWorkbook.Name & "'!thisworkbook.refreshform"

Manmy thanks for any help or advice in advance.

Paul

--
Message posted via http://www.officekb.com