Hi Julie
I don't know why a "Chart" menu appeared in the place of the "Data" menu and
so, it blocked the visible and enabled properties of the "Data" menu.
I followed all your instructions but nothing happened. Then, I decided run a
VBA instruction, step by step and putting special atention in the menus
behaviour. Thus, I realized that the "Data" menu appeared but then when the
"Chart" menu appeared, the "Data" menu disappeared.
As a taste, below I show the raw code that did the task: (excuses for
language)
Private Sub ReHabilitarImprimir()
'Por si existiera algún error
On Error Resume Next
Hoja1.Range("k2:k" & Hoja1.Range("j1")).ClearContents
'Para buscar en TODAS las barras (Herramientas ó Menús)
For Each Barra In Application.CommandBars
'Para buscar en TODOS los controles (Comandos ó Submenús)
For Each Comando In Barra.Controls
Debug.Print Barra.Name & "," & Barra.Type & "," & Barra.Visible
Barra.Visible = True
'Inicia un "bucle" de búsqueda (a través de una función "recursiva")
Hoja1.Range("k" & Hoja1.Range("j1")) = Barra.Name & "-" &
Comando.Caption & "-" & Comando.ID & "-" & Comando.Enabled & "-" &
Comando.Visible
Siguiente = AcentuarImprimir(Comando)
'"Busca" en el siguiente botón
Next Comando
'"Busca" en la siguiente Barra de Comandos
Next Barra
'Fin del procedimiento
End Sub
'Función "recursiva" para "bajar" por los menús
Private Function AcentuarImprimir(Comando As CommandBarControl) As Integer
'Por si existiera algún error
On Error Resume Next
'"Inicializa" la variable del bucle
Siguiente = 0
'Para "afectar" sólo a Comandos ó Menús
Select Case Comando.Type
Case 1, 2, 4, 6, 7, 13, 18 'Si es un botón de comando...
Select Case Comando.ID '"Ver" cuál es
Case 928, 3031, 860, 861, 2034, 862, 806, 863, 2521 ' 19, 21, 22
'Si es "copiar", "cortar" ó "pegar"
Comando.Enabled = True 'Lo "HABILITA"
End Select
Case Else 'Si es un Menú (ó Submenú)
'... seguir buscando "más abajo"
For Each Contenedor In Comando.Controls
'... haciendo una "Re-Llamada" de la función
Siguiente = Siguiente + AcentuarImprimir(Contenedor)
Next Contenedor '(continuar con el "bucle")
Siguiente = Siguiente - 1 '(regresar al bucle en el mismo control)
End Select 'y ...
'continuar "la llamada" a la función con "el siguiente"
AcentuarProhibidos = Siguiente + 1
'Fin de la función
End Function
Thanks anyway
Luis