View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Context-sensitive custom menu item.

It eliminates the behavior in all versions with commandbars.

--
Regards,
Tom Ogilvy


"Doug Glancy" wrote in message
...
I agree. If you search on my name, you'll see that I was asking a similar
question last night. I did not get a workable answer. The idea I'd

picked
up from an old post was to copy a built-in Excel button with the behavior
desired, i.e., only enabled while in a chart, and then assign your own
caption and OnAction. However, assigning the OnAction seems to eliminate
the original behavior (at least in XL 03).

Aside from that I'm not sure what you could use. If your charts are on
their own sheets, you could perhaps use SheetActivate/DeActivate events.
You might be able to do something with the SelectionChange event, e.g., if
no range is selected, but I'm not sure.

I still think my first answer is a good one because it's (fairly) simple.

good luck,

Doug

"Murray" wrote in message
oups.com...
Thanks Doug

That's a worthwhile option, but still doesn't really achieve what I was
after. Perhaps I've confused the issue by talking about the worksheet
menu bar - I suppose what I really want to know is how do I put a new
menu item on my menu that is only active if a chart is selected? This
would be preferable to coding a check to see if a chart is selected and
presenting the user with a message if one isn't. It's much nicer to
just make the option unavailable in the first place.

Regards

Murray