Foreign Language Issues with commands

MPW

Well-known Member
Joined
Oct 7, 2009
Messages
571
Office Version
  1. 365
Platform
  1. Windows
Hey All,

Problem using English VBA commands on systems that use another language. For instance 'Russian or Mandarin'

The following is an example of one of the problems we are encountering.
Code:
                       'English         English
Application.CommandBars("[B]Cell[/B]").Controls("[B]Copy[/B]").Enabled = False

I was able to find the ID numbers for the menu items so change the code to this:
Code:
'                               Was able to change the Copy command. 
Application.CommandBars("Cell").FindControl(ID:=19).Enabled = False

I found the commandbar ID number for the cell commandbar was 423

My question is what is the command to select the commandbar with it's ID number?

Thanks for the time.
 
Rory, Is this true? I have a screen shot of one of our teams that is having problems with our Script. I would like to upload it for you but am not sure how to do it. Any ideas?
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
You'd need to load it onto a file hosting site and then post a link here.
 
Upvote 0
OK here is the picture. Sorry for the wait.

http://i1347.photobucket.com/albums/p704/mark144/YakutScript_zpsc9519c3e.png[/IMG][/URL]


In other news...
I did have partial success with this on a different board.

The macro runs without errors in 2010 but I could see no effect on the copy command, to enable True of False. I put in some msgboxes to see what was going on.
Code:
     Set zb = Application.CommandBars(143)
     MsgBox zb.Name '  "[B]Built-In Menus[/B]"
     Set xb = zb.FindControl(, 30003)
     For Each yb In xb.Controls
          If yb.ID = 19 Then
               yb.Enabled = False
               MsgBox yb.ID  '  "[B]19[/B]"
               MsgBox yb.Enabled '  "[B]False[/B]"
          End If
     Next[COLOR=#333333]
[/COLOR]



Here is the link to the other board if it helps:
http://www.vbforums.com/showthread.p...dbars-in-Excel


This was the closest I have seen to doing what I am after.
See what you think.
 
Upvote 0
What menu are you trying to change? If it's the Cell menu, that code isn't referring to it.
 
Upvote 0
I enable and disable several menu items. some are in the cell menu some are in the basic menu tabs. In the picture I believe it is showing the 'Freeze Panes' menu item being disabled. Today I will be sending a macro to him to catalog all of the menus in his Excel so that I can compare it up to mine.
 
Upvote 0
There are 2 main commands that I am unsure how to handle using ID numbers.
Code:
Application.CommandBars("Window").Controls.Item("Unfreeze Panes").Enabled = False
Application.CommandBars("Format").Controls.Item("Row").Controls.Item("Unhide").Enabled = False
Any help with these would be great.
Thanks
 
Upvote 0
Ok, so I found the FreezePanes command.
Code:
Application.CommandBars("Window").FindControl(ID:=443).Enabled = False

Just need one more.
Code:
Application.CommandBars("Format").Controls.Item("Row").Controls.Item("Unhide").Enabled = False
 
Upvote 0
You could just use a loop to disable all controls with the required id:
Code:
for each ctl in Application.CommandBars.findControls(id:=884)
    ctl.enabled = false
 next ctl
 
Upvote 0
That disabled 3 commands.
1. Format>Row>UnHide
2. Right Click> Row Menu> UnHide

Do you know what the 3rd one is?

In any event I think that this should do the trick. Closure at last! Mawahaha!

Thank you Rory!
 
Upvote 0
There are two Row menus.
 
Upvote 0

Forum statistics

Threads
1,216,590
Messages
6,131,610
Members
449,657
Latest member
Timber5

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top