Quitar proteger del Toolbar en versiones espanol y ingles

Joke

Board Regular
Joined
Jan 21, 2004
Messages
171
Tengo un modelo en EXCEL que necesito usar ambas en computadores con EXCEL Ingles que Espanol.

Todos los macros funcionan bien solamente tengo problema con este codigo:

Application.CommandBars("Worksheet Menu Bar").Controls(6).Controls("protection").Enabled = False

En Excel inglesh tengo que usar Protecion y en espanol Proteger........Los demas codigos si funcionan en las dos versiones de Excel sin problemas.

Application.CommandBars("Drawing").Visible = False
Application.CommandBars("Web").Visible = False
Application.CommandBars("worksheet menu bar").Controls(6).Controls("macro").Enabled = False

Que puedo hacer hay un codigo mas general para indicar la opcion de proteger o puede investigar que version de Excel se usan???

Gracias para ayudarme!

Joke
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Re: Quitar proteger del Toolbar en versiones espanol y ingle

Encontro la solucion mi misma

En lugar de ("protection") yo usa (6) os sea protecion es la sexta opcion adentro del menu 6 (herramientas)

Joke
 
Upvote 0
Re: Quitar proteger del Toolbar en versiones espanol y ingle

Es mejor usar el Id del control:

Application.CommandBars.FindControl(Id:=30017).Enabled = False
 
Upvote 0
Para ayudarles un poco más, aquí hay un par de rutinas que ayudan descubrir qué son los números de identificación de los varios controles para poder user .FindControl() más facilmente:

<font face=Courier New><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> ListButtons()
    <SPAN style="color:#00007F">Dim</SPAN> cb <SPAN style="color:#00007F">As</SPAN> CommandBar, C  <SPAN style="color:#00007F">As</SPAN> CommandBarControl
    <SPAN style="color:#00007F">Set</SPAN> cb = CommandBars("Worksheet Menu Bar")
    <SPAN style="color:#00007F">On</SPAN> <SPAN style="color:#00007F">Error</SPAN> <SPAN style="color:#00007F">Resume</SPAN> <SPAN style="color:#00007F">Next</SPAN>
    <SPAN style="color:#00007F">For</SPAN> i = 1 <SPAN style="color:#00007F">To</SPAN> cb.Controls.Count
        <SPAN style="color:#00007F">Set</SPAN> C = cb.Controls(i)
        Cells(i, 1) = i
        Cells(i, 2) = C.Caption
        Cells(i, 3) = C.ID
        Cells(i, 4) = C.Visible
        Cells(i, 5) = C.OnAction
        Cells(i, 6) = C.Enabled
    <SPAN style="color:#00007F">Next</SPAN> i
    
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>

<SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> ListButtons2()
    <SPAN style="color:#00007F">Dim</SPAN> cb <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Object</SPAN>, C  <SPAN style="color:#00007F">As</SPAN> CommandBarControl
    <SPAN style="color:#007F00">' ListButtons indicates that 30007 is the number for</SPAN>
    <SPAN style="color:#007F00">' the tools menu.</SPAN>
    <SPAN style="color:#00007F">Set</SPAN> cb = Application.CommandBars.FindControl(ID:=30007)
    <SPAN style="color:#00007F">On</SPAN> <SPAN style="color:#00007F">Error</SPAN> <SPAN style="color:#00007F">Resume</SPAN> <SPAN style="color:#00007F">Next</SPAN>
    <SPAN style="color:#00007F">For</SPAN> i = 1 <SPAN style="color:#00007F">To</SPAN> cb.Controls.Count
        <SPAN style="color:#00007F">Set</SPAN> C = cb.Controls(i)
        Cells(i, 1) = i
        Cells(i, 2) = C.Caption
        Cells(i, 3) = C.ID
        Cells(i, 4) = C.Visible
        Cells(i, 5) = C.OnAction
        Cells(i, 6) = C.Enabled
    <SPAN style="color:#00007F">Next</SPAN> i
    
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>

</FONT>

Después de correr el segundo, uno debe de ver que el número de identificación para el control de Proteger es 30029.

Saludos,
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,566
Members
452,652
Latest member
eduedu

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