PDA

View Full Version : Solved: "Action" menu item?



mvidas
03-30-2007, 08:24 AM
Hi all,

I was playing around some more with the commandbar earlier, and found something I'm a little confused about. Heres what I ran:Sub Weird()
Dim cBc As Object
For Each cBc In Application.CommandBars("Worksheet Menu Bar").Controls
Debug.Print cBc.Caption
Next
End SubHere is what I saw:
&File
&Edit
&View
&Insert
F&ormat
&Tools
&Data
A&ction
&Window
&Help
I noticed that 'Action' has a .visible property of false, but even setting it to true doesnt work (and no error). There are no controls in it--I'm guessing it gets populated/visible during certain conditions, but can't figure out a rhyme or reason.

Anyone know what it is for or anything?
Matt

Bob Phillips
03-30-2007, 08:37 AM
As far as I am aware, it serves no purpose; it has no subcontrols, it doesn't execute any code (at least nothing obvious), and so on.

It is probably some throw-back to when Excel commandbars were being developed, it may have been some debugging tool that didn't get taken out, a bit like those messages in the VBA Aanalysis Pak.

I have heard some claims that it has something to do with Lotus NotesFlow, but I have never used that so cannot verify. In fact, looking at the help for Lotus NotesFlow in help it seems to be referring to something else, so I doubt it.

The good news Matt is that A&ction is one of those controls only 'discovered' by real geeks, those who don't have a real life. Welcome to the club!

mvidas
03-30-2007, 08:49 AM
The good news Matt is that A&ction is one of those controls only 'discovered' by real geeks, those who don't have a real life. Welcome to the club!
It's a proud day for me! :beerchug: I really am kinda surprised this is the first time I've seen it, as I swear I've looked at them before. Maybe I just assumed it was normal without ever putting a thought into it.
It is weird that you can .delete it (without it coming back) but .visible=true doesnt work or error out.
Thanks, Bob!

Ivan F Moala
03-31-2007, 06:01 AM
The Action control is related to the "Chart Menu bar", it is fired when a sheet Chart is selected > Shows the "Chart Menu bar" and hides the "Worksheet menu bar". If you have a look @ the "Chart Menu bar" it has the same control.
Whilst it's state is invisble it is still Enabled.

If you select a chart and then run this you will see what I mean.



Sub TestcBc()
On Error Resume Next
Application.CommandBars.FindControl(30083).Execute
End Sub


Edit (Extra info)
BTW ... got ID from this



Sub Weird()
Dim cBc As Object
For Each cBc In Application.CommandBars("Worksheet Menu Bar").Controls
Debug.Print cBc.Caption & ":" & cBc.Id
Next
End Sub

mvidas
04-02-2007, 10:14 AM
Interesting.. I thought it might have something to do with that, but when I deleted the A&ction entry from the Worksheet Menu Bar and the Chart Menu Bar, the menus still switch depending on what is active.. could the Action control be the 'old' way MS did it, and then later just integrated it into the programming itself without removing the control?

Ivan F Moala
04-03-2007, 09:04 PM
Interesting, yes the Action button has been around since XL 97.
The above was just my theory on it .....