View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
jojo jojo is offline
external usenet poster
 
Posts: 21
Default US / EN VBA menus

Very interesting !!!

It doesn't work in french version because
Application.VBE.CommandBars("Menu Bar") is not kowned
Application.VBE.CommandBars("Barre de Menus") is knowned
but
Application.VBE.CommandBars(1) workes perfectly

I eventualy find the control I need :
In CommandBar 30007 (Tools) it was the 2578 control (VBAProject Properties)

But when in this dialogbox, impossible to manage without "SendKeys"
command. (As far as my knowledgement tells me)

And managiing from Access Application, the dialogBox doesn't open.

Nevertherless, the code you propose will be very usefull,

Many thanks fore all that,

Regards,

Joël


"Peter T" wrote:

Sub VBE_MainMenu()
Dim cb As CommandBar
Dim ctr As CommandBarControl
Set cb = Application.VBE.CommandBars("Menu Bar")
For Each ctr In cb.Controls
Debug.Print ctr.ID, ctr.Caption
Next
End Sub

30002 &File
30003 &Edit
30004 &View
30005 &Insert
30006 F&ormat
30165 &Debug
30012 &Run
30007 &Tools
30038 &Add-Ins
30009 &Window
30010 &Help

Sub VBE_ViewMenu()
Dim cbp As CommandBarPopup
Dim ctr As CommandBarControl
Set cbp = Application.VBE.CommandBars.FindControl(ID:=30004)
For Each ctr In cbp.Controls
Debug.Print ctr.ID, ctr.Caption
Next
End Sub

2558 &Code
2553 O&bject
939 &Definition
1822 Last Positio&n
473 &Object Browser
2554 &Immediate Window
2555 Local&s Window
2556 Watc&h Window
620 Call Stac&k...
2557 &Project Explorer ' << this one ?
222 Properties &Window
548 Toolbo&x
469 T&ab Order
30045 &Toolbars
106 Microsoft Excel


Sub ShowPrjExp()
' for testing close the Project Explorer window
Dim ctr As CommandBarControl
Set ctr = Application.VBE.CommandBars.FindControl(ID:=2557)
ctr.Execute
End Sub


The underlined letter I wanted to know was the first "e" of "Poperties" in
tools menu


I don't have Properties in the Tools menu


If you are trying to programatically change Project properties, eg lock for
viewing, add/remove password etc, I have something that can batch process
files. It doesn't use SendKeys. (it's not a password cracker)

Regards,
Peter T


"jojo" wrote in message
...
Thanks Peter,

I suppose my english was not comprehensible.

The menus I wanted to know about were those in VB Editor.

I'm not sure we can use "execute" in order to protect the VBProject via a
macro.

If you know a way to access the commandBAr of VB Editor, please tell us.

The underlined letter I wanted to know was the first "e" of "Poperties" in
tools menu

any way, lot of thanks for your answer.

regards,

Joël

"Peter T" wrote:

Sub abc()
Dim ctr As CommandBarControl
For Each ctr In CommandBars("worksheet menu bar").Controls
Debug.Print ctr.Caption
Next
End Sub

&File
&Edit
&View
&Insert
F&ormat
&Tools
&Data
A&ction
&Window
&Help

Let me guess, you are thinking about SendKeys. Generally you can use
myControl.Execute, use commandbars.findcontrol(ID:=x), no
internationalization worries.

Properties of VBAProject (which letter is underline)

Do you mean View, &Project Explorer, but you can use Ctrl-R in all
versions
(I guess?), but again better to use Excecute

Regards,
Peter T



"jojo" wrote in message
...
Hello every body !

I would like to know the exact english menu for VBA in excel

File, View etc...

But what I need above all, are the underlined letters for all these
menus,
specialy the tools menu (T, O, L or S underline), and in this menu,
what
about
Properties of VBAProject (which letter is underline)

I'm sure you have understood that I have not the US version with me
;-)))

I need this in order to use in a protection vba project by macro, and
use
the "SendKeys" method. This might be operational either in French excel
version (that is mine, and the maco is OK) or US/UK version.

Lot of thank's in advance,

best regards,

Joël